You can check the _body
property in the response, for example:
this.http.put(url, data) .map(response => { if (response['_body']) { // check response here. return response.json() } else { return {} // or return null. } }) .subscribe( response => console.log(response), error => console.log(error), );
source share