1

I'm dealing with a third party webservice, where I have to make a POST-request, which contains a JSON. But how to do with jQuery?

Everytime I want POST, I get an error like 'Cross-Origin not allowed'. I read, that is normal, but I didn't find a valid solution. So I'm not able to recommend my customers "Hey, please start your browser with special flags". On the other hand, I'm not able to make adjustments on the server side. But making POST requests to other resources shouldn't be a big deal!?

user3417078
  • 265
  • 4
  • 15

1 Answers1

5

You can't fix it on your side with just javascript.

There are two solutions:

1) contact the third party api provider, ask her to allow cross origin requests.

2) Proxy your ajax calls through your own server (of the same domain than the web page) so that you have: web page --> your server --> third party server

AlexG
  • 3,617
  • 1
  • 23
  • 19