Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > REST API Connections > RestConnection class > RestConnection Methods

requestWithAuth

Scroll Prev Next More

 

This function adds authentication data to the request and executes it.

Syntax

 

requestWithAuth($request)

Arguments

$request

HttpRequest object

Return value

 

If the operation was successful it returns the body of the server's response.

If unsuccessful it returns false.

Examples

 

Use lastError() function to get the error details. If the server returns an error, lastError() returns the whole server response, header and the body.

 

$rconn = getRESTConn();
$request = new HttpRequest( "https://api.service.com/resource" );
$response = $rconn->requestWithAuth( $request );

 

 

 

 

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software