Please enable JavaScript to view this site.

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

lastError

Scroll Prev Next More

Returns last error message

Syntax

 

lastError()

 

Arguments

no arguments

Return value

 

string. text description of an error.

 

When the server returns an error, the message shows all data returned from the server, HTTP header and response body.

 

Example

 

$rconn = getRESTConn();
$result = $rconn->requestJson( "/resource", "GET" );
if( $result === false ) {
echo "Error occurred. Description: ";
echo $rconn->lastError();
} else {
echo "Request successfult. Result: ";
 print_r( $result );
}

 

 

 

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