I am trying to use `https.requestRestlet` but it g...
# suitescript
m
I am trying to use
https.requestRestlet
but it gives me an html response with code 500, and message
An unexpected error has occurred. Please click here to notify support and provide your contact information.
I hate it when NS doesn't give a meaningful response message. Did anyone tried this method before? Here is my code:
Copy code
var headers = {
   Accept: "application/json",
};
var res = https.requestRestlet({
   body: payload,
   method: "POST",
   headers: headers,
   deploymentId: "customdeploy_edc_invoices_sync",
   scriptId: 230,
});
b
use the Content-Type header instead of the Accept header
make sure your restlet's return type matches the header
m
Will try it...
It worked, thanks very much. @battk