Angular JS POST request not sending JSON data

前端 未结 7 1743
忘掉有多难
忘掉有多难 2020-12-01 10:30

I am trying to send an object as JSON to my webservice in Flask that is expecting JSON in the request data.

I have tested the service manually by sending JSON data a

7条回答
  •  时光取名叫无心
    2020-12-01 11:03

    try to use absolute url. if it not works, check if service's response has headers:

    Access-Control-Allow-Origin and Access-Control-Allow-Headers

    for example:

    "Access-Control-Allow-Origin": "*"
    "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"
    

提交回复
热议问题