Interface Github\HttpClient\HttpClientInterface

Implemented byGithub\HttpClient\CachedHttpClient, Github\HttpClient\HttpClient

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

Public Methods

Hide inherited methods

MethodDescriptionDefined By
authenticate() Authenticate a user for all next requests. Github\HttpClient\HttpClientInterface
delete() Send a DELETE request. Github\HttpClient\HttpClientInterface
get() Send a GET request. Github\HttpClient\HttpClientInterface
patch() Send a PATCH request. Github\HttpClient\HttpClientInterface
post() Send a POST request. Github\HttpClient\HttpClientInterface
put() Send a PUT request. Github\HttpClient\HttpClientInterface
request() Send a request to the server, receive a response, decode the response and returns an associative array. Github\HttpClient\HttpClientInterface
setHeaders() Set HTTP headers. Github\HttpClient\HttpClientInterface
setOption() Change an option value. Github\HttpClient\HttpClientInterface

Method Details

authenticate() public abstract method

Authenticate a user for all next requests.

public abstract void authenticate ( $tokenOrLogin, $password, $authMethod )
$tokenOrLogin string

GitHub private token/username/client ID

$password null|string

GitHub password/secret (optionally can contain $authMethod)

$authMethod null|string

One of the AUTH_* class constants

throws Github\Exception\InvalidArgumentException

If no authentication method was given

delete() public abstract method

Send a DELETE request.

public abstract Guzzle\Http\Message\Response delete ( $path, $body null, array $headers = [] )
$path string

Request path

$body mixed

Request body

$headers array

Reconfigure the request headers for this call only

get() public abstract method

Send a GET request.

public abstract Guzzle\Http\Message\Response get ( $path, array $parameters = [], array $headers = [] )
$path string

Request path

$parameters array

GET Parameters

$headers array

Reconfigure the request headers for this call only

patch() public abstract method

Send a PATCH request.

public abstract Guzzle\Http\Message\Response patch ( $path, $body null, array $headers = [] )
$path string

Request path

$body mixed

Request body

$headers array

Reconfigure the request headers for this call only

post() public abstract method

Send a POST request.

public abstract Guzzle\Http\Message\Response post ( $path, $body null, array $headers = [] )
$path string

Request path

$body mixed

Request body

$headers array

Reconfigure the request headers for this call only

put() public abstract method

Send a PUT request.

public abstract Guzzle\Http\Message\Response put ( $path, $body, array $headers = [] )
$path string

Request path

$body mixed

Request body

$headers array

Reconfigure the request headers for this call only

request() public abstract method

Send a request to the server, receive a response, decode the response and returns an associative array.

public abstract Guzzle\Http\Message\Response request ( $path, $body, $httpMethod 'GET', array $headers = [] )
$path string

Request path

$body mixed

Request body

$httpMethod string

HTTP method to use

$headers array

Request headers

setHeaders() public abstract method

Set HTTP headers.

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

Change an option value.

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

The option name

$value mixed

The value

throws Github\Exception\InvalidArgumentException