I
I
iluxa18102019-03-14 17:39:33
Angular
iluxa1810, 2019-03-14 17:39:33

Error during WebSocket handshake: Unexpected response code 400. How to overcome?

In general, there is Web API and Angular face.
On the Web API side, I wrote:

services.AddCors(options =>
            {
                options.AddPolicy("CorsPolicy", b =>
                    {
                        b.AllowAnyOrigin()
                            .AllowAnyMethod()
                            .AllowAnyHeader()
                            .AllowCredentials();
                    }
                );
            });

app.UseCors("CorsPolicy");

In the Angular service, I send a request to the controller: And I catch the error: Error during WebSocket handshake: Unexpected response code 400 What did I miss? The address on which I am knocking successfully works through PostMan and the answer is obtained. Authentication is used screw.
this._httpClient.get(`Адрес API`);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question