Hi,
I have a userevent script that call a third party API to get info returned. All that I send is a uuid in JSON format {
caseuuid: "c18f62c7-e5ea-4808-ab78-a4d20a08dbc0"
}
The response is posted below.
{
type: "http.ClientResponse",
code: 400,
headers: {
Age: "0",
age: "0",
"Cache-Control": "public, max-age=0, must-revalidate",
"cache-control": "public, max-age=0, must-revalidate",
"Content-Length": "12",
"content-length": "12",
"Content-Type": "application/json; charset=utf-8",
"content-type": "application/json; charset=utf-8",
Date: "Wed, 19 Apr 2023 10:02:48 GMT",
date: "Wed, 19 Apr 2023 10:02:48 GMT",
Etag: ""vorzd2wwp7c"",
etag: ""vorzd2wwp7c"",
Server: "Vercel",
server: "Vercel",
"Strict-Transport-Security": "max-age=63072000",
"strict-transport-security": "max-age=63072000",
Via: "1.1 mono001",
via: "1.1 mono001",
"X-Matched-Path": "/api/status",
"x-matched-path": "/api/status",
"X-Vercel-Cache": "MISS",
"x-vercel-cache": "MISS",
"X-Vercel-Id": "dub1::iad1::kx7tg-1681898568200-207b1489f1cf",
"x-vercel-id": "dub1::iad1::kx7tg-1681898568200-207b1489f1cf"
},
body: "["Required"]"
}
If I make the same call in Postman I get the response back.
This is my API call :
var urlStr = 'https://www.snagportal.cloud/api/status';
var headerObj = {
'Content-Type': 'application/json',
};
var response = https.request({
method: https.Method.GET,
url: urlStr,
body: {"caseuuid": "c18f62c7-e5ea-4808-ab78-a4d20a08dbc0"}, // JSON.stringify(bodyObj),
headers: headerObj,
});
Response in Postman
You can test it and should get {
"classification": "Awaiting user action"
}
My response.body return:
[
"Required"
]
What am I missing? How can I see what my request was that I send?