PHP Class Automattic\Wistia\Client

Inheritance: use trait Automattic\Wistia\Traits\ApiMethodsTrait
Show file Open project: Automattic/wistia-php

Public Properties

Property Type Description
$client object The HTTP client
$format string Response format
$last_response_code integer The response code of the last request

Public Methods

Method Description
__construct ( array $params ) Init the HTTP Client
__wakeup ( ) Prevent unserialization
create_media ( string $file, array $query = [] ) : object Create a new media. Wistia handles upload differently than other methods.
delete ( $endpoint, $query = [] ) : string Send a DELETE request
get ( $endpoint, $query = [] ) : string Send a GET request
get_client ( ) : object Returns the client
get_token ( ) : string Get the token
post ( $endpoint, $query = [] ) : string Send a POST request
put ( $endpoint, $query = [] ) : string Send a PUT request

Private Methods

Method Description
_make_request ( string $type, string $endpoint, $query = [] ) : string Make a request

Method Details

__construct() public method

Init the HTTP Client
public __construct ( array $params )
$params array

__wakeup() public method

Prevent unserialization
public __wakeup ( )

create_media() public method

The API endpoint is different and the parameters are completely different. We need a new Client to handle this kind of requests.
public create_media ( string $file, array $query = [] ) : object
$file string
$query array
return object

delete() public method

Send a DELETE request
public delete ( $endpoint, $query = [] ) : string
return string

get() public method

Send a GET request
public get ( $endpoint, $query = [] ) : string
return string

get_client() public method

Returns the client
public get_client ( ) : object
return object

get_token() public method

Get the token
public get_token ( ) : string
return string

post() public method

Send a POST request
public post ( $endpoint, $query = [] ) : string
return string

put() public method

Send a PUT request
public put ( $endpoint, $query = [] ) : string
return string

Property Details

$client public property

The HTTP client
public object $client
return object

$format public property

Response format
public string $format
return string

$last_response_code public property

The response code of the last request
public int $last_response_code
return integer