Reputation: 28
I want to bypass CORS Policy to GET data XML from another domain. I try so much but have no luck. There are:
For you, JSONP is faster or Proxy is Faster ?
Thanks for watching ?
Upvotes: 0
Views: 1700
Reputation: 33815
If the other domain does not explicitly trust you, you cannot invoke it from the client via AJAX for security reasons unless you use JSONP.
However, you can only use JSONP as long as you are sticking to only GET requests and the server knows how to respond with a JSONP-formatted response.
On the other hand, if they DO explicitly trust you, you have a few options.
On the other hand, if you create a proxy server-side on your end that can call across to the other domain, you'll have no issues whatsoever.
A server-side proxy should in theory always be slower than ajax options since you are making two calls instead of one.
Upvotes: 1