Reputation: 965
I used angluar4 http,
Such as login request server,
When I click the button to submit the form, Google Chrome's network to capture the two requests, one of which is zone.js: 2744
(the return of the data is wrong).
Why is there twice?
My code reference here: https://angular.cn/tutorial/toh-pt6
1
2
3
Upvotes: 4
Views: 2383
Reputation: 1941
https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
You are seeing the OPTIONS call first - which is a call the browser does automatically (in certain conditions) when requesting data from a different origin (server) than what you served the html from.
Upvotes: 6