HTTP Response is 200 but Response Body is empty.
Hello,
I've created a simple script for sending a POST request to an API with the "application/x-www-form-urlencoded" content type. Here's the script:
var http = new HttpClientRequest("URL");
http.header["Content-Type"] = "application/x-www-form-urlencoded";
http.header["Cache-control"] = "no-cache";
http.header["Connection"] = "keep-alive";
http.body = "param1=value1¶m2=value2¶m3=value3¶m4=value4";
http.method = "POST";
http.execute();
logInfo(http.response.code);
logInfo(JSON.stringify(http.response));
http.disconnect();
When I run this script, I receive a response with a 200 status code, but the response body is empty.
I've reached out to the API technical team, and they have tested the API from their end. They confirmed that they are receiving the request correctly and sending a proper response.
Please note that we have also added the URL to the "urlpermissions" in the control panel.
Could this issue be related to the "application/x-www-form-urlencoded" content type? I would appreciate it if someone could review this and share their thoughts.
Screenshot:

Thank you,
Krishna