jsog

angular httpclient custom json parser (jsog)

时光怂恿深爱的人放手 提交于 2020-12-05 11:49:09
问题 I'm just discovering the new Angular 4.3.x HttpClient Module, and I may very well be overlooking something simple. I would like to know if it is possible to register a custom JSON Deserializer and still get the benefit of the typed HttpClient get/post/put. It happens that for performance reason, my backend returns JSOG, which is an extension of JSON, instead of JSON content. Currently I make all my requests using a normal get(url, {responseType: 'text'}) , and then run the response through