18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

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.