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

0

1 Answer 1

-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.

Sign up to request clarification or add additional context in comments.

5 Comments

all set in correct way.bt it shows an preflight response
can you share the code with us??
yes,i added that
make sure that, you write the "application/json"
check that, i have added the code for you.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.