jQuery cross domain POST shenanigans

前端 未结 4 1200
北海茫月
北海茫月 2020-12-09 10:16

I\'m trying to authenticate to an API, which only allows you to authenticate using a POST with JSON as form data, in the format of {\"username\":\"myusername\",\"password\":

4条回答
  •  再見小時候
    2020-12-09 10:36

    You should follow a different pattern. Your local JS will do an ajax post to a local URL which will accept the POST method with your json data.

    At this point your server code will do an HTTP POST with proper data to the remote server, get the response, and send it back to the calling js.

提交回复
热议问题