-
Notifications
You must be signed in to change notification settings - Fork 74
HttpClient
Andrea Zoellner edited this page Jul 30, 2015
·
2 revisions
- Class name: HttpClient
- Namespace: Crew\Unsplash
const TEST_MODE = 'test'
const STAGING_MODE = 'staging'
private mixed $httpClient
- Visibility: private
private mixed $host = 'api.unsplash.com'
- Visibility: private
private mixed $scheme = 'https'
- Visibility: private
public \Crew\Unsplash\Crew\Unsplash\Connection $connection
Crew\Unsplash\Connection object link to the HttpClient
Needs to be set to the class before running anything else.
- Visibility: public
- This property is static.
mixed Crew\Unsplash\HttpClient::__construct()
Generate a new http client variable. Retrieve the authorization token generated by the $connection object.
- Visibility: public
\Crew\Unsplash\GuzzleHttp\Psr7\Response Crew\Unsplash\HttpClient::send(string $method, $arguments)
Send an http request through the http client.
Generate a new request method with the http method and the URI is passed.
- Visibility: public
- $method string - <p>http method to be trigger</p>
- $arguments mixed
string Crew\Unsplash\HttpClient::getHost()
Retrieve the host to which the client will send the request.
- Visibility: public
string Crew\Unsplash\HttpClient::getScheme()
Retrieve the scheme to which the client will send the request.
- Visibility: public
\Crew\Unsplash\GuzzleHttp\HandlerStack Crew\Unsplash\HttpClient::setHandler(string $authorization)
Generate a new handler that will manage the http request.
Some middleware is also set to manage the authorization header and the requested URI.
- Visibility: private
- $authorization string - <p>Authorization code to pass in the header</p>
mixed Crew\Unsplash\HttpClient::setHostAndScheme()
Set the host and the scheme information if it's run in test mode or staging mode.
- Visibility: private