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
Asked
Active
Viewed 523 times
1 Answers
-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
-
all set in correct way.bt it shows an preflight response – Ajith mohan Oct 01 '17 at 04:35
-
can you share the code with us?? – Kunvar Singh Oct 01 '17 at 05:02
-
yes,i added that – Ajith mohan Oct 01 '17 at 05:22
-
make sure that, you write the "application/json" – Kunvar Singh Oct 01 '17 at 05:29
-
check that, i have added the code for you. – Kunvar Singh Oct 01 '17 at 05:36