DataSift_User::post PHP Метод

post() публичный Метод

Make a call to a DataSift API endpoint.
public post ( string $endpoint, array $params = [], $headers = [], $ingest = false ) : array
$endpoint string The endpoint of the API call.
$params array The parameters to be passed along with the request.
Результат array The response from the server.
    public function post($endpoint, $params = array(), $headers = array(), $ingest = false)
    {
        $res = call_user_func(array($this->_api_client, 'call'), $this, $endpoint, 'post', $params, $headers, $this->getUserAgent(), array(), $ingest);
        $this->_rate_limit = $res['rate_limit'];
        $this->_rate_limit_remaining = $res['rate_limit_remaining'];
        return $this->handleResponse($res);
    }

Usage Example

Пример #1
0
 /**
  * Generates a curl request to the Ingestion Endpoint 
  */
 public function ingest($data_set)
 {
     if (strlen($this->_source_id) == 0) {
         throw new DataSift_Exception_InvalidData('Cannot make request without a source ID');
     }
     if (empty($data_set)) {
         throw new DataSift_Exception_InvalidData('Cannot make request without a valid data set');
     }
     return $this->_user->post($this->getSourceId(), $data_set, array(), true);
 }
All Usage Examples Of DataSift_User::post