PHP Class Google\Spreadsheet\DefaultServiceRequest

Author: Asim Liaquat ([email protected])
Inheritance: implements Google\Spreadsheet\ServiceRequestInterface
Mostrar archivo Open project: asimlqt/php-google-spreadsheet-client Class Usage Examples

Protected Properties

Property Type Description
$accessToken Google\Spreadsheet\Request Request object
$curlParams array cURL parameters
$headers array Request headers
$serviceUrl string Service url
$sslVerifyPeer boolean SSL verify peer
$tokenType string Token type (defaults to OAuth for BC)
$userAgent string User agent

Public Methods

Method Description
__construct ( string $accessToken, string $tokenType = "OAuth" ) Initializes the service request object.
addCurlParam ( string $name, mixed $value ) : DefaultServiceRequest Add an extra curl parameter or override an existing one
addHeader ( string $name, string $value ) : Google\Spreadsheet\DefaultServiceRequest Add a header to the headers array
delete ( string $url ) : string Perform a delete request
get ( string $url ) : string Perform a get request
getCurlParams ( ) : array Get currently set curl params
getHeaders ( ) : array Get request headers
getServiceUrl ( ) : string Get the hostname of the spreadsheet service
getSslVerifyPeer ( ) : boolean Get the value for verifying the peers ssl certificate.
getUserAgent ( ) : string Get the user agent
post ( string $url, mixed $postData ) : string Perform a post request
put ( string $url, mixed $postData ) : string Perform a put request
removeHeader ( string $name ) : Google\Spreadsheet\DefaultServiceRequest
setHeaders ( array $headers ) : Google\Spreadsheet\DefaultServiceRequest Set optional request headers.
setSslVerifyPeer ( boolean $sslVerifyPeer ) : DefaultServiceRequest Verify the peer"s ssl certificate
setUserAgent ( string $userAgent ) : Google\Spreadsheet\DefaultServiceRequest Set the user agent. It is a good ides to leave this as is.

Protected Methods

Method Description
execute ( $ch ) : string Executes the api request.
initRequest ( string $url, array $requestHeaders = [] ) : resource Initialize the curl session

Method Details

__construct() public method

Initializes the service request object.
public __construct ( string $accessToken, string $tokenType = "OAuth" )
$accessToken string
$tokenType string

addCurlParam() public method

Add an extra curl parameter or override an existing one
public addCurlParam ( string $name, mixed $value ) : DefaultServiceRequest
$name string 'CURLOPT_*' constant
$value mixed
return DefaultServiceRequest

addHeader() public method

Add a header to the headers array
public addHeader ( string $name, string $value ) : Google\Spreadsheet\DefaultServiceRequest
$name string
$value string
return Google\Spreadsheet\DefaultServiceRequest

delete() public method

Perform a delete request
public delete ( string $url ) : string
$url string
return string

execute() protected method

Executes the api request.
protected execute ( $ch ) : string
return string the xml response

get() public method

Perform a get request
public get ( string $url ) : string
$url string
return string

getCurlParams() public method

Get currently set curl params
public getCurlParams ( ) : array
return array

getHeaders() public method

Get request headers
public getHeaders ( ) : array
return array

getServiceUrl() public method

Get the hostname of the spreadsheet service
public getServiceUrl ( ) : string
return string

getSslVerifyPeer() public method

Get the value for verifying the peers ssl certificate.
public getSslVerifyPeer ( ) : boolean
return boolean

getUserAgent() public method

Get the user agent
public getUserAgent ( ) : string
return string

initRequest() protected method

Initialize the curl session
protected initRequest ( string $url, array $requestHeaders = [] ) : resource
$url string
$requestHeaders array
return resource

post() public method

Perform a post request
public post ( string $url, mixed $postData ) : string
$url string
$postData mixed
return string

put() public method

Perform a put request
public put ( string $url, mixed $postData ) : string
$url string
$postData mixed
return string

removeHeader() public method

public removeHeader ( string $name ) : Google\Spreadsheet\DefaultServiceRequest
$name string
return Google\Spreadsheet\DefaultServiceRequest

setHeaders() public method

Set optional request headers.
public setHeaders ( array $headers ) : Google\Spreadsheet\DefaultServiceRequest
$headers array associative array of key value pairs
return Google\Spreadsheet\DefaultServiceRequest

setSslVerifyPeer() public method

Verify the peer"s ssl certificate
public setSslVerifyPeer ( boolean $sslVerifyPeer ) : DefaultServiceRequest
$sslVerifyPeer boolean
return DefaultServiceRequest

setUserAgent() public method

Set the user agent. It is a good ides to leave this as is.
public setUserAgent ( string $userAgent ) : Google\Spreadsheet\DefaultServiceRequest
$userAgent string
return Google\Spreadsheet\DefaultServiceRequest

Property Details

$accessToken protected_oe property

Request object
protected Request,Google\Spreadsheet $accessToken
return Google\Spreadsheet\Request

$curlParams protected_oe property

cURL parameters
protected array $curlParams
return array

$headers protected_oe property

Request headers
protected array $headers
return array

$serviceUrl protected_oe property

Service url
protected string $serviceUrl
return string

$sslVerifyPeer protected_oe property

SSL verify peer
protected bool $sslVerifyPeer
return boolean

$tokenType protected_oe property

Token type (defaults to OAuth for BC)
protected string $tokenType
return string

$userAgent protected_oe property

User agent
protected string $userAgent
return string