PHP Class MC4WP_API_v3_Client

Mostrar archivo Open project: dannyvankooten/mailchimp-for-wordpress Class Usage Examples

Public Methods

Method Description
__construct ( string $api_key ) Constructor
delete ( string $resource ) : mixed
get ( string $resource, array $args = [] ) : mixed
get_last_response ( ) : array | WP_Error
get_last_response_body ( ) : string
get_last_response_headers ( ) : array
patch ( string $resource, array $data ) : mixed
post ( string $resource, array $data ) : mixed
put ( string $resource, array $data ) : mixed

Private Methods

Method Description
get_headers ( ) : array
parse_response ( array | WP_Error $response ) : mixed
request ( string $method, string $resource, array $data = [] ) : mixed
reset ( ) Empties all data from previous response

Method Details

__construct() public method

Constructor
public __construct ( string $api_key )
$api_key string

delete() public method

public delete ( string $resource ) : mixed
$resource string
return mixed

get() public method

public get ( string $resource, array $args = [] ) : mixed
$resource string
$args array
return mixed

get_last_response() public method

public get_last_response ( ) : array | WP_Error
return array | WP_Error

get_last_response_body() public method

public get_last_response_body ( ) : string
return string

get_last_response_headers() public method

public get_last_response_headers ( ) : array
return array

patch() public method

public patch ( string $resource, array $data ) : mixed
$resource string
$data array
return mixed

post() public method

public post ( string $resource, array $data ) : mixed
$resource string
$data array
return mixed

put() public method

public put ( string $resource, array $data ) : mixed
$resource string
$data array
return mixed