Fetch -API returning HTML instead of JSON Fetch -API returning HTML instead of JSON json json

Fetch -API returning HTML instead of JSON


Header is not correct. Valid header for JSON response:

headers: {    'Accept': 'application/json',    'Content-Type': 'application/json',  }


Sometimes Apis return html instead of json if you are not logged in, confirm that as well


Also double check you have selected the correct HTTP method in the dropdown box, next to the input bar on postman.