Свойство | Тип | Описание | |
---|---|---|---|
$verify_ssl | * SSL Verification Read before disabling: http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/ |
Метод | Описание | |
---|---|---|
__construct ( string $api_key ) | Create a new instance | |
delete ( string $method, array $args = [], integer $timeout = 10 ) : array | false | Make an HTTP DELETE request - for deleting data | |
get ( string $method, array $args = [], integer $timeout = 10 ) : array | false | Make an HTTP GET request - for retrieving data | |
getLastError ( ) : array | false | Get the last error returned by either the network transport, or by the API. | |
getLastRequest ( ) : array | Get an array containing the HTTP headers and the body of the API request. | |
getLastResponse ( ) : array | Get an array containing the HTTP headers and the body of the API response. | |
new_batch ( string $batch_id = null ) : |
Create a new instance of a Batch request. Optionally with the ID of an existing batch. | |
patch ( string $method, array $args = [], integer $timeout = 10 ) : array | false | Make an HTTP PATCH request - for performing partial updates | |
post ( string $method, array $args = [], integer $timeout = 10 ) : array | false | Make an HTTP POST request - for creating and updating items | |
put ( string $method, array $args = [], integer $timeout = 10 ) : array | false | Make an HTTP PUT request - for creating new items | |
subscriberHash ( string $email ) : string | Convert an email address into a 'subscriber hash' for identifying the subscriber in a method URL | |
success ( ) : boolean | Was the last request successful? |
Метод | Описание | |
---|---|---|
attachRequestPayload ( resource &$ch, array $data ) | Encode the data and attach it to the request | |
determineSuccess ( array $response, array | false $formattedResponse ) : boolean | Check if the response was successful or a failure. If it failed, store the error. | |
findHTTPStatus ( array $response, array | false $formattedResponse ) : integer | Find the HTTP status code from the headers or API response body | |
formatResponse ( array $response ) : array | false | Decode the response and format any error messages for debugging | |
makeRequest ( string $http_verb, string $method, array $args = [], integer $timeout = 10 ) : array | false | Performs the underlying HTTP request. Not very exciting. |
public __construct ( string $api_key ) | ||
$api_key | string | Your MailChimp API key |
public delete ( string $method, array $args = [], integer $timeout = 10 ) : array | false | ||
$method | string | URL of the API request method |
$args | array | Assoc array of arguments (if any) |
$timeout | integer | Timeout limit for request in seconds |
Результат | array | false | Assoc array of API response, decoded from JSON |
public get ( string $method, array $args = [], integer $timeout = 10 ) : array | false | ||
$method | string | URL of the API request method |
$args | array | Assoc array of arguments (usually your data) |
$timeout | integer | Timeout limit for request in seconds |
Результат | array | false | Assoc array of API response, decoded from JSON |
public getLastError ( ) : array | false | ||
Результат | array | false | describing the error |
public getLastRequest ( ) : array | ||
Результат | array | Assoc array |
public getLastResponse ( ) : array | ||
Результат | array | Assoc array with keys 'headers' and 'body' |
public patch ( string $method, array $args = [], integer $timeout = 10 ) : array | false | ||
$method | string | URL of the API request method |
$args | array | Assoc array of arguments (usually your data) |
$timeout | integer | Timeout limit for request in seconds |
Результат | array | false | Assoc array of API response, decoded from JSON |
public post ( string $method, array $args = [], integer $timeout = 10 ) : array | false | ||
$method | string | URL of the API request method |
$args | array | Assoc array of arguments (usually your data) |
$timeout | integer | Timeout limit for request in seconds |
Результат | array | false | Assoc array of API response, decoded from JSON |
public put ( string $method, array $args = [], integer $timeout = 10 ) : array | false | ||
$method | string | URL of the API request method |
$args | array | Assoc array of arguments (usually your data) |
$timeout | integer | Timeout limit for request in seconds |
Результат | array | false | Assoc array of API response, decoded from JSON |
public subscriberHash ( string $email ) : string | ||
string | The subscriber's email address | |
Результат | string | Hashed version of the input |