PHP Class OAuth2\HttpClient

Show file Open project: vznet/oauth_2.0_client_php

Public Methods

Method Description
__construct ( string $url, string $method, string $parameters = null, array $header = [] )
execute ( ) executes the curl request
getHeaders ( ) : array
getResponse ( ) : string
parseStringToArray ( string $string, string $firstDelimiter, string $secondDelimiter ) : array parses a string with two delimiters to an array
setDebug ( boolean $debug )

Method Details

__construct() public method

public __construct ( string $url, string $method, string $parameters = null, array $header = [] )
$url string
$method string
$parameters string
$header array any additional header which should be set

execute() public method

executes the curl request
public execute ( )

getHeaders() public method

public getHeaders ( ) : array
return array

getResponse() public method

public getResponse ( ) : string
return string

parseStringToArray() public static method

example: param1=value1¶m2=value2 will result with delimiters & and = to array( 'param1' => 'value1', 'param2' => 'value2', )
public static parseStringToArray ( string $string, string $firstDelimiter, string $secondDelimiter ) : array
$string string
$firstDelimiter string
$secondDelimiter string
return array

setDebug() public method

public setDebug ( boolean $debug )
$debug boolean