PHP Class Google\Cloud\RequestWrapper

Datei anzeigen Open project: GoogleCloudPlatform/gcloud-php Class Usage Examples

Public Methods

Method Description
__construct ( array $config = [] )
send ( Psr\Http\Message\RequestInterface $request, array $options = [] ) : Psr\Http\Message\ResponseInterface Deliver the request.

Private Methods

Method Description
convertToGoogleException ( Exception $ex ) : ServiceException Convert any exception to a Google Exception.
fetchCredentials ( ) : array Fetches credentials.
getExceptionMessage ( Exception $ex ) : string Gets the exception message.
getRetryFunction ( ) : boolean Determines whether or not the request should be retried.
getToken ( ) : string Gets the access token.
signRequest ( Psr\Http\Message\RequestInterface $request ) : Psr\Http\Message\RequestInterface Sign the request.

Method Details

__construct() public method

public __construct ( array $config = [] )
$config array [optional] { Configuration options. Please see {@see \Google\Cloud\RequestWrapperTrait::setCommonDefaults()} for the other available options. @type string $accessToken Access token used to sign requests. @type callable $authHttpHandler A handler used to deliver Psr7 requests specifically for authentication. @type callable $httpHandler A handler used to deliver Psr7 requests. @type array $httpOptions HTTP client specific configuration options. @type bool $shouldSignRequest Whether to enable request signing. }

send() public method

Deliver the request.
public send ( Psr\Http\Message\RequestInterface $request, array $options = [] ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\RequestInterface Psr7 request.
$options array [optional] { Request options. @type int $retries Number of retries for a failed request. **Defaults to** `3`. @type array $httpOptions HTTP client specific configuration options. }
return Psr\Http\Message\ResponseInterface