I have an application which is using Angular 7 for the front end and ASP.Net Core 2.2 for serving APIs. When I am sending POST
or PUT
requests using Google Chrome browser, I get ERR_INVALID_HTTP_RESPONSE
error.
When I downgrade my .Net Core to version 2.1, everything works fine
Also when I am testing my app in Firefox, again everything is working fine!
I do not know how to resolve this issue
I am using Google Chrome version 71
When I check the Network tab in Google Chrome, I found that Chrome sends a preflight request to the server too...
Here is what recorded in Network tab:
First:
Request URL: http://localhost:12346/api/XXXX
Request Method: OPTIONS
Status Code: 204 No Content
Remote Address: [::1]:12346
Referrer Policy: no-referrer-when-downgrade
Then:(which cause the error)
Request URL: http://localhost:12346/api/XXXX
Referrer Policy: no-referrer-when-downgrade
As you see chrome does not send any POST
request to the server (which should send).