Differences: JSONP vs GET

That’s my question, what are the differences between those requests ?

I am having an issue with get request I am trying to perform, I am getting the error

Read More

XMLHttpRequest cannot load http://urbanetradio.com/wp-json/posts. The ‘Access-Control-Allow-Origin’ header has a value ‘http://localhost:8100‘ that is not equal to the supplied origin. Origin ‘http://run.plnkr.co‘ is therefore not allowed access.

that get request is toward my-site-url/wp-json/postswhich is a WordPress account. And this is the method I am using

so, someone says, use jsonp instead of get, but why?

Related posts

Leave a Reply

1 comment

  1. Jsonp is what is used for web APIs that support cross origin resource sharing. The article below gives an example of how to make a request that supports cors. If the webapi is not configured to allow requests from your host you may not be able to make it work without changing the api though.

    Web requests that support cors:
    http://www.html5rocks.com/en/tutorials/cors/

    Setting up a web api that uses cors:
    http://mobile.codeguru.com/csharp/.net/net_asp/using-cross-origin-resource-sharing-cors-in-asp.net-web-api.html