You are here

public function AcquiaLiftDrupalHttpClient::post in Acquia Lift Connector 7

Same name and namespace in other branches
  1. 7.2 includes/AcquiaLiftDrupalHttpClient.inc \AcquiaLiftDrupalHttpClient::post()

Implements AcquiaLiftDrupalHttpClientInterface::post().

Overrides AcquiaLiftDrupalHttpClientInterface::post

File

includes/acquia_lift.classes.inc, line 1827
Provides an agent type for Acquia Lift

Class

AcquiaLiftDrupalHttpClient
This is just an OOP wrapper around drupal_http_request.

Code

public function post($uri = NULL, $headers = NULL, $body = NULL, array $options = array()) {
  $data = $body ? $this
    ->encodeBody($body) : NULL;
  $headers = $headers ? $headers : array();
  $options += array(
    'timeout' => self::REQUEST_TIMEOUT_VALUE_DEFAULT,
  );
  $options = array(
    'method' => 'POST',
    'data' => $data,
    'headers' => $headers,
  ) + $options;
  return drupal_http_request($uri, $options);
}