Ionic HttpClient 正在发送 GET 请求而不是 POST

Ionic HttpClient is sending a GET request instead of a POST

我正在尝试使用 HttpClient 发送 post 请求。

constructor (private http: HttpClient) { }

this.http.post(url + 'auth/login', data).subscribe(res => { });

但是浏览器发送了 4 个请求而不是一个 POST 请求:

我读到它叫做“预检请求”https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests

我收到 405 Method Not Allowed 错误,因为服务器不支持此路径的 GET 请求 The GET method is not supported for this route. Supported methods: POST.

不幸的是,我无法修改服务器以接受 GET 请求,无论如何我可以阻止浏览器发送 GET 请求吗?

提前致谢。

我发现这只发生在“http://”上。

我试过“https://”,它工作正常:)