How can postman send requests without having problems with cors?

0

Currently I use Angular 2+ in some applications and I'm having trouble solving color problems. When the request is made by Postman, everything happens as expected, but when I try through my application, a cors error is thrown on the console informing that the control of headers content type is not authorized.

I tried to add some headers in my request to try to allow any type of request.

I tried something like:

let header = new HttpHeaders();

    header = header.set("Content-Type", "application/x-www-form-urlencoded")
    header.append("Access-Control-Allow-Headers", "*")

I also tried all other types of headers available for cors that I found, access control origin, anyway, I still have a problem with cors.

I have read that the best way to handle cors is to enable the server. But I was curious how postman can handle requests without being configured on the server.

Would it be a fault that the angle can not send these headers in a way that allows? Is it a posthumous trick that can ignore this?

Very curious.

    
asked by anonymous 31.10.2018 / 14:09

0 answers