Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Basic Authentication get Operation using REST API

PSPS Members
edited December 2013 in Sahi Pro
Hi,

In latest sahi 5.1.0 documentation I found that, SAHI exposed REST APIS.
My use case is I want to call a get operation on a URL which has basic authentication. Is this possible using Sahi REST API? If so please let me know the procedure?

I have tried using this, but I am getting 401 exception. Please let me know how to proceed further?
$request = new RESTRequest();
$response = new RESTResponse();
$request.setURL("https://domain/api/account/1";);
$response = $request.submit("get");
var $s = $response.getResponseCode();
_alert($s);
var $s1 = $response.getBodyAsString()
_alert($s1);



Thanks in advance

Regards,
PS
Sign In or Register to comment.