HTTP request that sends an entity-body in the request message (POST, PUT)
Expanded class hierarchy of EntityEnclosingRequestInterface
All classes that implement EntityEnclosingRequestInterface
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);
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityEnclosingRequestInterface:: |
public | function | Add POST fields to use in the request | 1 |
EntityEnclosingRequestInterface:: |
public | function | Add a POST file to the upload | 1 |
EntityEnclosingRequestInterface:: |
public | function | Add POST files to use in the upload | 1 |
EntityEnclosingRequestInterface:: |
public | function | Configure how redirects are handled for the request | 1 |
EntityEnclosingRequestInterface:: |
public | function | Get the body of the request if set | 1 |
EntityEnclosingRequestInterface:: |
public | function | Get a POST field from the request | 1 |
EntityEnclosingRequestInterface:: |
public | function | Get the post fields that will be used in the request | 1 |
EntityEnclosingRequestInterface:: |
public | function | Get a POST file from the request | 1 |
EntityEnclosingRequestInterface:: |
public | function | Returns an associative array of POST field names to PostFileInterface objects | 1 |
EntityEnclosingRequestInterface:: |
constant | |||
EntityEnclosingRequestInterface:: |
public | function | Remove a POST field or file by name | 1 |
EntityEnclosingRequestInterface:: |
public | function | Remove a POST file from the request | 1 |
EntityEnclosingRequestInterface:: |
public | function | Set the body of the request | 1 |
EntityEnclosingRequestInterface:: |
public | function | Set a POST field value | 1 |
EntityEnclosingRequestInterface:: |
constant | |||
HasDispatcherInterface:: |
public | function | Add an event subscriber to the dispatcher | 2 |
HasDispatcherInterface:: |
public | function | Helper to dispatch Guzzle events and set the event name on the event | 2 |
HasDispatcherInterface:: |
public static | function | Get a list of all of the events emitted from the class | 2 |
HasDispatcherInterface:: |
public | function | Get the EventDispatcher of the request | 2 |
HasDispatcherInterface:: |
public | function | Set the EventDispatcher of the request | 2 |
MessageInterface:: |
public | function | Add a Cache-Control directive on the message | 1 |
MessageInterface:: |
public | function | Add a header to an existing collection of headers. | 1 |
MessageInterface:: |
public | function | Add and merge in an array of HTTP headers. | 1 |
MessageInterface:: |
public | function | Get a Cache-Control directive from the message | 1 |
MessageInterface:: |
public | function | Retrieve an HTTP header by name. Performs a case-insensitive search of all headers. | 1 |
MessageInterface:: |
public | function | Get an array of message header lines | 1 |
MessageInterface:: |
public | function | Get all headers as a collection | 1 |
MessageInterface:: |
public | function | Get application and plugin specific parameters set on the message. | 1 |
MessageInterface:: |
public | function | Get the raw message headers as a string | 2 |
MessageInterface:: |
public | function | Get a tokenized header as a Collection | 1 |
MessageInterface:: |
public | function | Check if the message has a Cache-Control directive | 1 |
MessageInterface:: |
public | function | Check if the specified header is present. | 1 |
MessageInterface:: |
public | function | Remove a Cache-Control directive from the message | 1 |
MessageInterface:: |
public | function | Remove a specific HTTP header. | 1 |
MessageInterface:: |
public | function | Set an HTTP header | 1 |
MessageInterface:: |
public | function | Overwrite all HTTP headers with the supplied array of headers | 1 |
MessageInterface:: |
public | function | Set a tokenized header on the request that implodes a Collection of data into a string separated by a token. | 1 |
RequestInterface:: |
public | function | Add a Cookie value by name to the Cookie header | 1 |
RequestInterface:: |
public | function | Returns whether or not the request can be cached | 1 |
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
public | function | Get the client used to transport the request | 1 |
RequestInterface:: |
public | function | Get a cookie value by name | 1 |
RequestInterface:: |
public | function | Get an array of Cookies | 1 |
RequestInterface:: |
public | function | Get the cURL options that will be applied when the cURL handle is created | 1 |
RequestInterface:: |
public | function | Get the host of the request | 1 |
RequestInterface:: |
public | function | Get the HTTP method of the request | 1 |
RequestInterface:: |
public | function | Get the password to pass in the URL if set | 1 |
RequestInterface:: |
public | function | Get the path of the request (e.g. '/', '/index.html') | 1 |
RequestInterface:: |
public | function | Get the port that the request will be sent on if it has been set | 1 |
RequestInterface:: |
public | function | Get the HTTP protocol version of the request | 1 |
RequestInterface:: |
public | function | Get the collection of key value pairs that will be used as the query string in the request | 1 |
RequestInterface:: |
public | function | Get the resource part of the the request, including the path, query string, and fragment | 1 |
RequestInterface:: |
public | function | Get the previously received {not been sent | 1 |
RequestInterface:: |
public | function | Get the URI scheme of the request (http, https, ftp, etc) | 1 |
RequestInterface:: |
public | function | Get the state of the request. One of 'complete', 'sending', 'new' | 1 |
RequestInterface:: |
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:: |
public | function | Get the username to pass in the URL if set | 1 |
RequestInterface:: |
constant | |||
RequestInterface:: |
public | function | Determine if the response body is repeatable (readable + seekable) | 1 |
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
public | function | Method to receive HTTP response headers as they are retrieved | 1 |
RequestInterface:: |
public | function | Remove a specific cookie value by name | 1 |
RequestInterface:: |
public | function | Send the request | 1 |
RequestInterface:: |
public | function | Set HTTP authorization parameters | 1 |
RequestInterface:: |
public | function | Set the client used to transport the request | 1 |
RequestInterface:: |
public | function | Set the host of the request. Including a port in the host will modify the port of the request. | 1 |
RequestInterface:: |
public | function | Set the path of the request (e.g. '/', '/index.html') | 1 |
RequestInterface:: |
public | function | Set the port that the request will be sent on | 1 |
RequestInterface:: |
public | function | Set the HTTP protocol version of the request (e.g. 1.1 or 1.0) | 1 |
RequestInterface:: |
public | function | Manually set a response for the request. | 1 |
RequestInterface:: |
public | function | Set the EntityBody that will hold the response message's entity body. | 1 |
RequestInterface:: |
public | function | Set the URI scheme of the request (http, https, ftp, etc) | 1 |
RequestInterface:: |
public | function | Set the state of the request | 1 |
RequestInterface:: |
public | function | Set the URL of the request | 1 |
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
constant | |||
RequestInterface:: |
public | function | Get the HTTP request as a string | 1 |