Is is possible to make a cross domain POST ajax request of application/json?

后端 未结 2 645
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 19:01

I am testing some csrf stuff, and I am wondering if it is possible to POST a cross domain ajax request with Content-Type: application/json

Every time I try

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 19:22

    It is possible if your browser supports so called Cross-Origin Resource Sharing (CORS), and all modern browsers, support this nowadays. In short, server should provide you Access-Control-Allow-Origin header.

    Also, regarding the fact that, as you've said, you does not bother about getting any information as response, why don't you just submit some form?

提交回复
热议问题