DataSift_User::put PHP Метод

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

Make a PUT call to a DataSift API endpoint.
public put ( string $endpoint, array $params = [], $headers = [] ) : 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 put($endpoint, $params = array(), $headers = array())
    {
        $res = call_user_func(array($this->_api_client, 'call'), $this, $endpoint, 'put', $params, $headers, $this->getUserAgent());
        $this->_rate_limit = $res['rate_limit'];
        $this->_rate_limit_remaining = $res['rate_limit_remaining'];
        return $this->handleResponse($res);
    }

Usage Example

Пример #1
0
 /**
  * Updates a recording with a new hash and or name
  *
  * @param string $id The id of the existing recording
  * @param string $hash The new hash of the pylon recording
  * @param string $name The new updated name of the recording
  *
  * @throws DataSift_Exception_InvalidData
  */
 public function update($id = false, $hash = false, $name = false)
 {
     if ($id) {
         $this->_id = $id;
     }
     if ($hash) {
         $this->_hash = $hash;
     }
     if ($name) {
         $this->_name = $name;
     }
     $params = array('id' => $this->_id, 'hash' => $this->_hash, 'name' => $this->_name);
     $this->_user->put('pylon/update', $params);
 }