Put http-functions

It has a function in the wix of put in the http-functions as in the example below:
export function put_myFunction(request) {
let options = {
“headers”: {
“Content-Type”: “application/json”
}
};
// get the request body
return request.body.text()
.then( (body) => {
// update the item in a collection
options.body = {
“inserido”: JSON.parse(body)
};
return ok(options);
// return wixData.update(“myUserCollection”, JSON.parse(body));
} )
.then( (results) => {
options.body = {
“inserted”: results
};
return ok(options);
} )
// something went wrong
.catch( (error) => {
options.body = {
“error”: error
};
return serverError(options);
} );
}
Anyone know how to work with json in the url. My url is: https://laudoimagem.wixsite.com/teste/_functions/myFunction/a/a

Hi Guilherme,

Here’s a good explanation on JSON .

Have fun,

Yisrael