You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 16, 2020. It is now read-only.
My PUT request works in the server - I get a 200 and positive results. But the http client I create has complains over my request and it actually throws an error.
Error: Parsing error : Unexpected token O in JSON at position 0
It seems to be an issue that originates from auto stringifying of JSON, but I can not find how to resolve...
My request looks like this:
const dataObj = {name: 'my-new-name'}
client.put('my-url', dataObj, (err, res, body) => {
if (err) {
this.snack.isOpen = true;
this.snack.message = "The operation couldn't be handled";
console.log('error!', err);
} else {
this.snack.isOpen = true;
this.snack.message = 'The virtualization is successfully updated';
console.log(res.statusCode);
}
});