I have quite a few REST endpoints that process the request and just return 200. I noticed that this is an error for matching the result with json() . If I try not to perform any mappings, I see a browser warning that it cannot parse XML. Since returning nothing is normal, I am curious how I should handle the response.
Here is a sample base code:
await this.http.put("/api/some_url", data).toPromise();
Here is the warning that appears in Firefox:
XML Parsing Error: no root element found Location: http://localhost/api/some_url Line Number 1, Column 1:
If I try to match with json() , it is completely reset. If I do nothing or try to match with text() , I just get a warning.
In all cases, the response headers contain Content-Length: 0 , so I'm surprised Angular2 / Firefox is trying to parse something. I do not know if this warning came from Angular2 or Firefox. I tried this on Chrome and IE and there were no warnings. Therefore, I am wondering if this is specific to Firefox.
Travis parks
source share