Cross-origin access to jsonp cors and cross-origin jsonpcors
I. JSONP
The commonly used Jquery framework supports jsonp requests. This method only supports the GET method, and the parameter size is limited. In addition, the background needs to encapsulate the results and return results based on the jsonp request method.
The default value of the jsonp parameter is callback, and jsonpCallback parameter is the randomly generated callback function name. If handleRequest is specified, the return value of the background parameter is handleRequest ("data ").
Ii. CORS
Cross-origin Resource Sharing (CORS) allows the browser and server to understand each other by customizing the HTTP header.
On the server side, CORS is supported mainly by setting the corresponding header:
Access-Control-Allow-Origin :*
Access-Control-Allow-Methods: GET, POST
Access-Control-Request-Headers:
Origin, X-Requested-With, Content-Type, Accept