Under the https protocol, the post request is cross-domain, but the get request is not.

under the https protocol, the post request is cross-domain, the get request is not cross-domain, and the http protocol is fine.

related codes

clipboard.png

clipboard.png

clipboard.png

clipboard.png

clipboard.png


PHP Code:

  http://localhost:3000");

header ("Access-control-Allow-Origin:*");

/ / the response header is set to ajax submission

header ("Access-Control-Allow-Headers:X-Requested-With");

/ / allow to carry user authentication credentials (that is, allow requests sent by the client to carry Cookie)

header ("Access-Control-Allow-Credentials:true");

write to the inside of the method

Menu