0

I'm using fetch API to get data from server using POST method. It return an error: Network request failure. when I try with a Facebook movie API it works good, then I try it with Postman width same key and userId and everything is okay enter image description here

this is what I have when I click on the TestAPI button

enter image description here

this is result in Postman width same configurations

enter image description here

zedArt
  • 487
  • 1
  • 10
  • 27

1 Answers1

0

The response that you are showing does not seems to be a JSON object (see the encoding issues) so when you try to do response.json() most likely fails because it can't parse it.

Try to log the response or do response.text() instead of response.json() to try it out.

Seems like your problem is on your php server code.

sebastianf182
  • 9,844
  • 3
  • 34
  • 66