React Native - Fetch POST request is sending as GET request

后端 未结 11 1135
感情败类
感情败类 2020-12-16 14:52

I\'m having issues when using FETCH.

I am trying to make a POST request using FETCH in react-native.

    fetch(\"http://www.example.co.uk/login\", {
         


        
11条回答
  •  猫巷女王i
    2020-12-16 15:35

    I had this issue when the POST request was to an HTTPS (rather than HTTP) server. For some reason, it would somewhere along the way be converted into a GET request.

    It turns out what I was doing incorrectly was sending the request to http://myserver.com:80 rather than to https://myserver.com:443. Once I switched it over to the proper prefix and ports, the request would properly send as a POST.

提交回复
热议问题