Class Github\HttpClient\HttpClient

InheritanceGithub\HttpClient\HttpClient
ImplementsGithub\HttpClient\HttpClientInterface
SubclassesGithub\HttpClient\CachedHttpClient

Performs requests on GitHub API. API documentation should be self-explanatory.

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
createRequest() Github\HttpClient\HttpClient

Property Details

$headers protected property
protected $headers = []
$options protected property
protected $options = ['base_url' => 'https://api.github.com/''user_agent' => 'php-github-api (http://github.com/KnpLabs/php-github-api)''timeout' => 10'api_limit' => 5000'api_version' => 'v3''cache_dir' => null]

Method Details

__construct() public method

public void __construct ( array $options = [], Guzzle\Http\ClientInterface $client null )
$options array
$client Guzzle\Http\ClientInterface
addListener() public method

public void addListener ( $eventName, $listener )
$eventName
$listener
addSubscriber() public method

public void addSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )
$subscriber
authenticate() public method

{@inheritDoc}

public void authenticate ( $tokenOrLogin, $password null, $method )
$tokenOrLogin
$password
$method
clearHeaders() public method

Clears used headers.

public void clearHeaders ( )
createRequest() protected method

protected void createRequest ( $httpMethod, $path, $body null, array $headers = [], array $options = [] )
$httpMethod
$path
$body
$headers
$options
delete() public method

{@inheritDoc}

public void delete ( $path, $body null, array $headers = [] )
$path
$body
$headers
get() public method

{@inheritDoc}

public void get ( $path, array $parameters = [], array $headers = [] )
$path
$parameters
$headers
getLastRequest() public method

public Guzzle\Http\Message\Request getLastRequest ( )
getLastResponse() public method

public Guzzle\Http\Message\Response getLastResponse ( )
patch() public method

{@inheritDoc}

public void patch ( $path, $body null, array $headers = [] )
$path
$body
$headers
post() public method

{@inheritDoc}

public void post ( $path, $body null, array $headers = [] )
$path
$body
$headers
put() public method

{@inheritDoc}

public void put ( $path, $body, array $headers = [] )
$path
$body
$headers
request() public method

{@inheritDoc}

public void request ( $path, $body null, $httpMethod 'GET', array $headers = [], array $options = [] )
$path
$body
$httpMethod
$headers
$options
setHeaders() public method

{@inheritDoc}

public void setHeaders ( array $headers )
$headers
setOption() public method

{@inheritDoc}

public void setOption ( $name, $value )
$name
$value