Problem with rbv_api.sendHttpPost(url, params, headers)

Posted by Deshani De Soyza on 10-Oct-2016 07:07


Can anybody explain how to send HTTP POST request properly within a rollbase object script trigger. When I try to send POST request  it didn't work for me.

Here is my code


var url = <url> ;
var headers = {"Content-Type":"application/x-www-form-urlencoded", "Authorization":"Basic " <authorization code>};
var params = {"grant_type":"refresh_token", "refresh_token":<refresh token>, "scope":"PRODUCTION"};

var resp = rbv_api.sendHttpPost(url, params, headers);


When I debug this code I got this error. -  "HTTP Error 400: HTTP call failed: Bad Request"
When I remove the content-type or change content type it gives this error. - "HTTP Error 415: HTTP call failed: Unsupported Media Type"

All Replies

This thread is closed