Skip to content
Discussion options

You must be logged in to vote

Hello Philip,

Can you send us the message that error shows? Generally, 400 error code is thrown when there is invalid syntax(JSON payload) or malformed request body.

In the case of a REST API with a JSON payload, 400's are typically, and correctly I would say, used to indicate that the JSON is invalid in some way according to the API specification for the service.

Related Solution

You need to use mode:"cors" when you are passing Content-type:"application/json"

The no-cors mode only works with some constraint. Covering from mdn docs regarding fetch

Note that mode: "no-cors" only allows a limited set of headers in the request:

I check that you've set request mode to no-cors in fetch opt…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@PhilipOyelegbin
Comment options

@meetzaveri
Comment options

@PhilipOyelegbin
Comment options

Answer selected by meetzaveri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants