We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
Hi, What if you want to add another content-type in the existing header is that possible?
Thank you very much. This is awesome!
Thanks Alex! Any idea how to make the same for HttpClient? It does not use class for options, just a plain object.
Hi Anton, I believe with HttpClient you can use interceptors. Basically, it will intercept outgoing http requests where you can clone them and dynamically change things like headers. There's a nice example in the docs: https://angular.io/guide/ht...
Great thanks! Shame on me for not RTFM better :)
It does not work for pot requests, Do you know how to work with post resquest.
Thanks for your time!
Using the custom class for setting headers will work for any request type from using http. Please ensure that you have it registered in the providers array.
thank you, this is really helpful!
There's a typo in the example. It should be Bearer instead of Beaer