interface EntityEnclosingRequestInterface

HTTP request that sends an entity-body in the request message (POST, PUT)

Hierarchy

Expanded class hierarchy of EntityEnclosingRequestInterface

All classes that implement EntityEnclosingRequestInterface

3 files declare their use of EntityEnclosingRequestInterface
ClientInterface.php in drupal/core/vendor/guzzle/http/Guzzle/Http/ClientInterface.php
CurlHandle.php in drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlHandle.php
RedirectPlugin.php in drupal/core/vendor/guzzle/http/Guzzle/Http/RedirectPlugin.php

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/EntityEnclosingRequestInterface.php, line 12

Namespace

Guzzle\Http\Message
View source
interface EntityEnclosingRequestInterface extends RequestInterface {
  const URL_ENCODED = 'application/x-www-form-urlencoded';
  const MULTIPART = 'multipart/form-data';

  /**
   * Set the body of the request
   *
   * @param string|resource|EntityBodyInterface $body               Body to use in the entity body of the request
   * @param string                              $contentType        Content-Type to set. Leave null to use an existing
   *                                                                Content-Type or to guess the Content-Type
   * @param bool                                $tryChunkedTransfer Try to use chunked Transfer-Encoding
   *
   * @return EntityEnclosingRequestInterface
   * @throws RequestException if the protocol is < 1.1 and Content-Length can not be determined
   */
  public function setBody($body, $contentType = null, $tryChunkedTransfer = false);

  /**
   * Get the body of the request if set
   *
   * @return EntityBodyInterface|null
   */
  public function getBody();

  /**
   * Get a POST field from the request
   *
   * @param string $field Field to retrieve
   *
   * @return mixed|null
   */
  public function getPostField($field);

  /**
   * Get the post fields that will be used in the request
   *
   * @return QueryString
   */
  public function getPostFields();

  /**
   * Set a POST field value
   *
   * @param string $key   Key to set
   * @param string $value Value to set
   *
   * @return EntityEnclosingRequestInterface
   */
  public function setPostField($key, $value);

  /**
   * Add POST fields to use in the request
   *
   * @param QueryString|array $fields POST fields
   *
   * @return EntityEnclosingRequestInterface
   */
  public function addPostFields($fields);

  /**
   * Remove a POST field or file by name
   *
   * @param string $field Name of the POST field or file to remove
   *
   * @return EntityEnclosingRequestInterface
   */
  public function removePostField($field);

  /**
   * Returns an associative array of POST field names to PostFileInterface objects
   *
   * @return array
   */
  public function getPostFiles();

  /**
   * Get a POST file from the request
   *
   * @param string $fieldName POST fields to retrieve
   *
   * @return array|null Returns an array wrapping an array of PostFileInterface objects
   */
  public function getPostFile($fieldName);

  /**
   * Remove a POST file from the request
   *
   * @param string $fieldName POST file field name to remove
   *
   * @return EntityEnclosingRequestInterface
   */
  public function removePostFile($fieldName);

  /**
   * Add a POST file to the upload
   *
   * @param string $field       POST field to use (e.g. file). Used to reference content from the server.
   * @param string $filename    Full path to the file. Do not include the @ symbol.
   * @param string $contentType Optional Content-Type to add to the Content-Disposition.
   *                            Default behavior is to guess. Set to false to not specify.
   *
   * @return EntityEnclosingRequestInterface
   */
  public function addPostFile($field, $filename = null, $contentType = null);

  /**
   * Add POST files to use in the upload
   *
   * @param array $files An array of POST fields => filenames where filename can be a string or PostFileInterface
   *
   * @return EntityEnclosingRequestInterface
   */
  public function addPostFiles(array $files);

  /**
   * Configure how redirects are handled for the request
   *
   * @param bool $strict       Set to true to follow strict RFC compliance when redirecting POST requests. Most
   *                           browsers with follow a 301-302 redirect for a POST request with a GET request. This is
   *                           the default behavior of Guzzle. Enable strict redirects to redirect these responses
   *                           with a POST rather than a GET request.
   * @param int  $maxRedirects Specify the maximum number of allowed redirects. Set to 0 to disable redirects.
   *
   * @return self
   */
  public function configureRedirects($strict = false, $maxRedirects = 5);

}

Members

Namesort descending Modifiers Type Description Overrides
EntityEnclosingRequestInterface::addPostFields public function Add POST fields to use in the request 1
EntityEnclosingRequestInterface::addPostFile public function Add a POST file to the upload 1
EntityEnclosingRequestInterface::addPostFiles public function Add POST files to use in the upload 1
EntityEnclosingRequestInterface::configureRedirects public function Configure how redirects are handled for the request 1
EntityEnclosingRequestInterface::getBody public function Get the body of the request if set 1
EntityEnclosingRequestInterface::getPostField public function Get a POST field from the request 1
EntityEnclosingRequestInterface::getPostFields public function Get the post fields that will be used in the request 1
EntityEnclosingRequestInterface::getPostFile public function Get a POST file from the request 1
EntityEnclosingRequestInterface::getPostFiles public function Returns an associative array of POST field names to PostFileInterface objects 1
EntityEnclosingRequestInterface::MULTIPART constant
EntityEnclosingRequestInterface::removePostField public function Remove a POST field or file by name 1
EntityEnclosingRequestInterface::removePostFile public function Remove a POST file from the request 1
EntityEnclosingRequestInterface::setBody public function Set the body of the request 1
EntityEnclosingRequestInterface::setPostField public function Set a POST field value 1
EntityEnclosingRequestInterface::URL_ENCODED constant
HasDispatcherInterface::addSubscriber public function Add an event subscriber to the dispatcher 2
HasDispatcherInterface::dispatch public function Helper to dispatch Guzzle events and set the event name on the event 2
HasDispatcherInterface::getAllEvents public static function Get a list of all of the events emitted from the class 2
HasDispatcherInterface::getEventDispatcher public function Get the EventDispatcher of the request 2
HasDispatcherInterface::setEventDispatcher public function Set the EventDispatcher of the request 2
MessageInterface::addCacheControlDirective public function Add a Cache-Control directive on the message 1
MessageInterface::addHeader public function Add a header to an existing collection of headers. 1
MessageInterface::addHeaders public function Add and merge in an array of HTTP headers. 1
MessageInterface::getCacheControlDirective public function Get a Cache-Control directive from the message 1
MessageInterface::getHeader public function Retrieve an HTTP header by name. Performs a case-insensitive search of all headers. 1
MessageInterface::getHeaderLines public function Get an array of message header lines 1
MessageInterface::getHeaders public function Get all headers as a collection 1
MessageInterface::getParams public function Get application and plugin specific parameters set on the message. 1
MessageInterface::getRawHeaders public function Get the raw message headers as a string 2
MessageInterface::getTokenizedHeader public function Get a tokenized header as a Collection 1
MessageInterface::hasCacheControlDirective public function Check if the message has a Cache-Control directive 1
MessageInterface::hasHeader public function Check if the specified header is present. 1
MessageInterface::removeCacheControlDirective public function Remove a Cache-Control directive from the message 1
MessageInterface::removeHeader public function Remove a specific HTTP header. 1
MessageInterface::setHeader public function Set an HTTP header 1
MessageInterface::setHeaders public function Overwrite all HTTP headers with the supplied array of headers 1
MessageInterface::setTokenizedHeader public function Set a tokenized header on the request that implodes a Collection of data into a string separated by a token. 1
RequestInterface::addCookie public function Add a Cookie value by name to the Cookie header 1
RequestInterface::canCache public function Returns whether or not the request can be cached 1
RequestInterface::CONNECT constant
RequestInterface::DELETE constant
RequestInterface::GET constant
RequestInterface::getClient public function Get the client used to transport the request 1
RequestInterface::getCookie public function Get a cookie value by name 1
RequestInterface::getCookies public function Get an array of Cookies 1
RequestInterface::getCurlOptions public function Get the cURL options that will be applied when the cURL handle is created 1
RequestInterface::getHost public function Get the host of the request 1
RequestInterface::getMethod public function Get the HTTP method of the request 1
RequestInterface::getPassword public function Get the password to pass in the URL if set 1
RequestInterface::getPath public function Get the path of the request (e.g. '/', '/index.html') 1
RequestInterface::getPort public function Get the port that the request will be sent on if it has been set 1
RequestInterface::getProtocolVersion public function Get the HTTP protocol version of the request 1
RequestInterface::getQuery public function Get the collection of key value pairs that will be used as the query string in the request 1
RequestInterface::getResource public function Get the resource part of the the request, including the path, query string, and fragment 1
RequestInterface::getResponse public function Get the previously received {not been sent 1
RequestInterface::getScheme public function Get the URI scheme of the request (http, https, ftp, etc) 1
RequestInterface::getState public function Get the state of the request. One of 'complete', 'sending', 'new' 1
RequestInterface::getUrl public function Get the full URL of the request (e.g. 'http://www.guzzle-project.com/') scheme://username:password@domain:port/path?query_string#fragment 1
RequestInterface::getUsername public function Get the username to pass in the URL if set 1
RequestInterface::HEAD constant
RequestInterface::isResponseBodyRepeatable public function Determine if the response body is repeatable (readable + seekable) 1
RequestInterface::OPTIONS constant
RequestInterface::PATCH constant
RequestInterface::POST constant
RequestInterface::PUT constant
RequestInterface::receiveResponseHeader public function Method to receive HTTP response headers as they are retrieved 1
RequestInterface::removeCookie public function Remove a specific cookie value by name 1
RequestInterface::send public function Send the request 1
RequestInterface::setAuth public function Set HTTP authorization parameters 1
RequestInterface::setClient public function Set the client used to transport the request 1
RequestInterface::setHost public function Set the host of the request. Including a port in the host will modify the port of the request. 1
RequestInterface::setPath public function Set the path of the request (e.g. '/', '/index.html') 1
RequestInterface::setPort public function Set the port that the request will be sent on 1
RequestInterface::setProtocolVersion public function Set the HTTP protocol version of the request (e.g. 1.1 or 1.0) 1
RequestInterface::setResponse public function Manually set a response for the request. 1
RequestInterface::setResponseBody public function Set the EntityBody that will hold the response message's entity body. 1
RequestInterface::setScheme public function Set the URI scheme of the request (http, https, ftp, etc) 1
RequestInterface::setState public function Set the state of the request 1
RequestInterface::setUrl public function Set the URL of the request 1
RequestInterface::STATE_COMPLETE constant
RequestInterface::STATE_ERROR constant
RequestInterface::STATE_NEW constant
RequestInterface::STATE_TRANSFER constant
RequestInterface::TRACE constant
RequestInterface::__toString public function Get the HTTP request as a string 1