PHP Класс DataSift_ApiClient

The DataSift_ApiClient class wraps access to the DataSift API. This software is the intellectual property of MediaSift Ltd., and is covered by retained intellectual property rights, including copyright.
Автор: Stuart Dallas ([email protected])
Показать файл Открыть проект

Открытые методы

Метод Описание
appendQueryString ( $url, $qs )
call ( DataSift_User $user, string $endPoint, $method, array $params = [], array $headers = [], string $userAgent = DataSift_User::USER_AGENT, $qs = [], $ingest = false ) : array Make a call to a DataSift API endpoint.

Защищенные методы

Метод Описание
decodeBody ( array $res ) : array Decode the JSON response depending on the format.

Приватные методы

Метод Описание
initialize ( string $method, boolean $ssl, string $url, array $headers, array $params, string $userAgent, $qs, $raw = false ) : resource Initalize the cURL connection.
parseHTTPResponse ( string $str ) : array Parse an HTTP response. Separates the headers from the body and puts the headers into an associative array.

Описание методов

appendQueryString() публичный статический Метод

public static appendQueryString ( $url, $qs )

call() публичный статический Метод

Make a call to a DataSift API endpoint.
public static call ( DataSift_User $user, string $endPoint, $method, array $params = [], array $headers = [], string $userAgent = DataSift_User::USER_AGENT, $qs = [], $ingest = false ) : array
$user DataSift_User The user's username.
$endPoint string The endpoint of the API call.
$params array The parameters to be passed along with the request.
$headers array The headers to be sent.
$userAgent string The HTTP User-Agent header.
Результат array The response from the server.

decodeBody() защищенный статический Метод

Decode the JSON response depending on the format.
protected static decodeBody ( array $res ) : array
$res array The parsed HTTP response.
Результат array An array of the decoded JSON response