When I check a call in Postman, using the single header INFO added with value of blopp, I get the result as expected (it's JWT containing the value passed in as sub, a bit dummy service, agreed on that). When I deactivate the header, I'm getting a token with an empty sub. This is the predicted behavior.
I'm executing the following script. When I check the call's result, I see a token recieved containing an empty sub, desipte sending in the headers.
const headers = new HttpHeaders({
"Content-Type": "application/json",
"Accept": "application/json",
"INFO": "blopp"
});
const options = { headers };
this.http.get<{ token: string }>(url, options)
.subscribe(next => console.log(next.token));
My diagnostic tells me that I somehow fail to pass in the headers, because the behavior aligns with the result of deactivating the headers in Postman (as well as executing the URL with no headers from the browser).
How should I pass the value to be a part of the invokation as a header? Alternatively, if I'm already doing it the right way, how can I diagnose it further without access to the backend (since it works in Postman, I'm sure it's something on my end).
I've made sure to respect the immutability and tested all the approaches listed here and I try to follow what the docs tell me.