I'm currently using HttpClient from '@angular/common/http' to perform a PUT operation.
Here is the Angular code snippet I am working with:
public updateDetails(data: Data) {
const url = '/project/rest/v1/configuration/device/update'
console.log(JSON.stringify(data));
let headers = new HttpHeaders();
headers.append('Content-Type' , 'application/json');
let body = JSON.stringify(data);
return this.http.put(url, data, { headers: headers })
.map(response => true)
.catch(err => {
console.log(err);
return Observable.of(false);
});
}
However, I am encountering an issue where I receive the following error:
HttpErrorResponse {headers: HttpHeaders, status: 400, statusText: "Bad Request",
I'm unsure of what I might be missing. I've tried passing the data in stringified format, but it's still resulting in the same error. Any assistance would be greatly appreciated.