Hi, all. Has anyone encountered an issue on `type=...
# suitescript
r
Hi, all. Has anyone encountered an issue on
type=Not Acceptable, status=406
when using
https
methods? I am using
<http://https.post|https.post>
, and tried adding
Accept
property, but didn’t seem to make any differences as it still output the error. I tried reaching the endpoint with Postman with same parameter, and it went through. so I believe it might not be an issue at the endpoint I am hittting.
Copy code
var header = {
      "Content-Type": "application/json;charset=utf-8",
      "client-id": "MY-CLIENT-ID",
      "client-secret": "MY-CLIENT_SECRET",
      Accept: "*/*",
    };

<http://https.post|https.post>({
      url: 'URL',
      body: 'data',
      header: header,
    });
b
post to an echo service like https://httpbin.org/#/ instead
you can then compare the request that suitescript is making to the one that postman makes
1
r
To anybody that might have this issue, I found out that I never get to apply the header because in
<http://https.post|https.post>
function, it should’ve been
headers
property instead of `header`:
Copy code
<http://https.post|https.post>({
      url: 'URL',
      body: 'data',
      headers: header,
    });