Simon Irjala
08/25/2021, 9:30 AMcurl --location --request POST '<https://url.com/oauth/token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id=id-id-id&client_secret=secretsecretsecret&grant_type=client_credentials'
Here's me trying the same from NetSuite:
<http://https.post|https.post>({
"url": "<https://url.com/oauth/token>",
"headers": {
"Content-Type": "application/x-www-form-urlencoded",
},
"body": "client_id=id-id-id&client_secret=secretsecretsecret&grant_type=client_credentials"
})
But then I get this error:
Invalid content-type: text/html;charset=UTF-8 received from upstream server
battk
08/25/2021, 10:02 AMbattk
08/25/2021, 10:02 AMbattk
08/25/2021, 10:03 AMSimon Irjala
08/25/2021, 10:03 AMSimon Irjala
08/25/2021, 10:13 AM{
"body": {
"args": {},
"data": "",
"files": {},
"form": {
"client_id": "id-id-id",
"client_secret": "secretsecretsecret",
"grant_type": "client_credentials"
},
"headers": {
"Accept": "text/*",
"Accept-Encoding": "gzip, deflate",
"Content-Length": "81",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "<http://httpbin.org|httpbin.org>",
"User-Agent": "NetSuite/2021.1 (SuiteScript)",
"X-Amzn-Trace-Id": "Root=1-612616bc-5864b4314743e0270237d607"
},
"json": null,
"method": "POST",
"origin": "----",
"url": "<https://httpbin.org/anything>"
}
}
battk
08/25/2021, 10:15 AMbattk
08/25/2021, 10:16 AMbattk
08/25/2021, 10:16 AMbattk
08/25/2021, 10:16 AMSimon Irjala
08/25/2021, 10:19 AMSimon Irjala
08/25/2021, 10:20 AM