Angular 2.0 Http client quick tip for firefox
Tuesday, June 14, 2016
When getting HTTP response from a REST API using Angular 2.0 HTTP client you will probably won’t mess around with your request headers. You’ll probably count on the service to return a JSON formatted response, subscribeto this response and go ahead using it’s .json() method which will use JSON.parse of your browser API. However, while this solution works fine using chrome, Firefox behave differently. While in chrome, the HTTP Accept headers will be */* , on Firefox it will put text/html,application/xhtml+xmlwhich basically will cause your server side to return its response in XML form. Therefore...
one comment