React Native - Fetch POST request is sending as GET request

后端 未结 11 1127
感情败类
感情败类 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条回答
  •  粉色の甜心
    2020-12-16 15:47

    Similar to Rishijay's answer, my issue was with JSON.stringify not properly converting the body of POST request.

    The way I solved this was using build from the search-params node module to make it work. My fetch contents had body like this body: build({...})

提交回复
热议问题