Relative Content

Tag Archive for reactjsjsonpostrequesthttp-post

JS, React How to pass JSON data with POST method to backend without OPTIONS request?

We’re making a project with both frontend and backend, there is auth form, which should make POST request to backend, giving JSON object with email and password of user. If I specify 'Content-Type': 'application/json', then we see 2 requests instead of one: options (first) and post (second) requests, that results an error even with running backend (screenshot provides errors without running backend, only frontend)

JS, React How to pass JSON data with POST method to backend without OPTIONS request?

We’re making a project with both frontend and backend, there is auth form, which should make POST request to backend, giving JSON object with email and password of user. If I specify 'Content-Type': 'application/json', then we see 2 requests instead of one: options (first) and post (second) requests, that results an error even with running backend (screenshot provides errors without running backend, only frontend)