I am trying to post a request to my site and I am using SSJS HTTP post method. But the POST request is throwing error ""

Unable to retrieve security descriptor for this frame.

Im not sure what i am missing here also i just have the content type as header no other headers are required for my request. Kindly find my code below,

   var inputjson="{\"username\":\"test@test.com\",\"password\":\"testtbot1\",\"Privatekey\":\"0lemon9087\"}";
   var url="https://mysandbox.com/api/Rest/v1/Authenticate";
   var content = [0];
   var headername="[Content-Type]";
   var headervalues="[application/json]";
   var result = HTTP.Post(url,"application/json",inputjson,headername,headervalues);

I have tried Stringify payload but its also throwing the same error.


Try something like this:

<script runat="server">

var url = “https://mysandbox.com/api/Rest/v1/Authenticate”;
var payload = {
        username: "test@test.com",
        password: "testtbot1",
        privatekey: “0lemon9087”
var contentType = “application/json”;

try {
   var request = HTTP.Post(url, contentType, Stringify(payload));
} catch (error) {
  • Array of header name and values are the required parameters
    – Manoj
    Nov 15 '19 at 8:50

There was a syntax issue, instead of array of headers i have declared as string so fixing the syntax solved the issue

var headername=[];
var headervalues=[];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.