1

source code when I POST data from postman it shows an correct response data, but when i POST data using app(client) side it shows an Failed to load http://localhost:3000/done: Response for preflight has invalid HTTP status code 404

1 Answers1

-1

At the time of data posting, your local server (means backend server should be on), and post the data through, Header,queryparam or body,

and make sure that same params, you are recieving at backend side,

 $http.post('http://localhost:9191/api/signin', {
    username: 'some username',
    password: 'some password'
  }, {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'key': '123'
    }
  })
  .then(function(response) {
    console.log(response)
  });

And don't use json.stringify for data object, now send only object.

Kunvar Singh
  • 1,779
  • 2
  • 13
  • 21