Interface Guzzle\Http\Message\EntityEnclosingRequestInterface

ExtendsGuzzle\Http\Message\RequestInterface
Implemented byGuzzle\Http\Message\EntityEnclosingRequest

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

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__toString() Guzzle\Http\Message\RequestInterface
addCookie() Add a Cookie value by name to the Cookie header Guzzle\Http\Message\RequestInterface
addHeader() Add a header to an existing collection of headers. Guzzle\Http\Message\MessageInterface
addHeaders() Add and merge in an array of HTTP headers. Guzzle\Http\Message\MessageInterface
addPostFields() Add POST fields to use in the request Guzzle\Http\Message\EntityEnclosingRequestInterface
addPostFile() Add a POST file to the upload Guzzle\Http\Message\EntityEnclosingRequestInterface
addPostFiles() Add POST files to use in the upload Guzzle\Http\Message\EntityEnclosingRequestInterface
addSubscriber() Add an event subscriber to the dispatcher Guzzle\Common\HasDispatcherInterface
configureRedirects() Configure how redirects are handled for the request Guzzle\Http\Message\EntityEnclosingRequestInterface
dispatch() Helper to dispatch Guzzle events and set the event name on the event Guzzle\Common\HasDispatcherInterface
getAllEvents() Get a list of all of the events emitted from the class Guzzle\Common\HasDispatcherInterface
getBody() Get the body of the request if set Guzzle\Http\Message\EntityEnclosingRequestInterface
getClient() Get the client used to transport the request Guzzle\Http\Message\RequestInterface
getCookie() Get a cookie value by name Guzzle\Http\Message\RequestInterface
getCookies() Get an array of Cookies Guzzle\Http\Message\RequestInterface
getCurlOptions() Get the cURL options that will be applied when the cURL handle is created Guzzle\Http\Message\RequestInterface
getEventDispatcher() Get the EventDispatcher of the request Guzzle\Common\HasDispatcherInterface
getHeader() Retrieve an HTTP header by name. Performs a case-insensitive search of all headers. Guzzle\Http\Message\MessageInterface
getHeaderLines() Get an array of message header lines (e.g. ["Host: example.com", . Guzzle\Http\Message\MessageInterface
getHeaders() Get all headers as a collection Guzzle\Http\Message\MessageInterface
getHost() Get the host of the request Guzzle\Http\Message\RequestInterface
getMethod() Get the HTTP method of the request Guzzle\Http\Message\RequestInterface
getParams() Get application and plugin specific parameters set on the message. Guzzle\Http\Message\MessageInterface
getPassword() Get the password to pass in the URL if set Guzzle\Http\Message\RequestInterface
getPath() Get the path of the request (e.g. '/', '/index.html') Guzzle\Http\Message\RequestInterface
getPort() Get the port that the request will be sent on if it has been set Guzzle\Http\Message\RequestInterface
getPostField() Get a POST field from the request Guzzle\Http\Message\EntityEnclosingRequestInterface
getPostFields() Get the post fields that will be used in the request Guzzle\Http\Message\EntityEnclosingRequestInterface
getPostFile() Get a POST file from the request Guzzle\Http\Message\EntityEnclosingRequestInterface
getPostFiles() Returns an associative array of POST field names to PostFileInterface objects Guzzle\Http\Message\EntityEnclosingRequestInterface
getProtocolVersion() Get the HTTP protocol version of the request Guzzle\Http\Message\RequestInterface
getQuery() Get the collection of key value pairs that will be used as the query string in the request Guzzle\Http\Message\RequestInterface
getRawHeaders() Get the raw message headers as a string Guzzle\Http\Message\MessageInterface
getResource() Get the resource part of the the request, including the path, query string, and fragment Guzzle\Http\Message\RequestInterface
getResponse() Get the previously received {@see Response} or NULL if the request has not been sent Guzzle\Http\Message\RequestInterface
getResponseBody() Get the EntityBody that will hold the resulting response message's entity body. This response body will only be used for successful responses. Intermediate responses (e.g. redirects) will not use the targeted response body. Guzzle\Http\Message\RequestInterface
getScheme() Get the URI scheme of the request (http, https, ftp, etc) Guzzle\Http\Message\RequestInterface
getState() Get the state of the request. One of 'complete', 'transfer', 'new', 'error' Guzzle\Http\Message\RequestInterface
getUrl() Get the full URL of the request (e.g. 'http://www.guzzle-project.com/') Guzzle\Http\Message\RequestInterface
getUsername() Get the username to pass in the URL if set Guzzle\Http\Message\RequestInterface
hasHeader() Check if the specified header is present. Guzzle\Http\Message\MessageInterface
removeCookie() Remove a specific cookie value by name Guzzle\Http\Message\RequestInterface
removeHeader() Remove a specific HTTP header. Guzzle\Http\Message\MessageInterface
removePostField() Remove a POST field or file by name Guzzle\Http\Message\EntityEnclosingRequestInterface
removePostFile() Remove a POST file from the request Guzzle\Http\Message\EntityEnclosingRequestInterface
send() Send the request Guzzle\Http\Message\RequestInterface
setAuth() Set HTTP authorization parameters Guzzle\Http\Message\RequestInterface
setBody() Set the body of the request Guzzle\Http\Message\EntityEnclosingRequestInterface
setClient() Set the client used to transport the request Guzzle\Http\Message\RequestInterface
setEventDispatcher() Set the EventDispatcher of the request Guzzle\Common\HasDispatcherInterface
setHeader() Set an HTTP header and overwrite any existing value for the header Guzzle\Http\Message\MessageInterface
setHeaders() Overwrite all HTTP headers with the supplied array of headers Guzzle\Http\Message\MessageInterface
setHost() Set the host of the request. Including a port in the host will modify the port of the request. Guzzle\Http\Message\RequestInterface
setPath() Set the path of the request (e.g. '/', '/index.html') Guzzle\Http\Message\RequestInterface
setPort() Set the port that the request will be sent on Guzzle\Http\Message\RequestInterface
setPostField() Set a POST field value Guzzle\Http\Message\EntityEnclosingRequestInterface
setProtocolVersion() Set the HTTP protocol version of the request (e.g. 1.1 or 1.0) Guzzle\Http\Message\RequestInterface
setResponse() Manually set a response for the request. Guzzle\Http\Message\RequestInterface
setResponseBody() Set the EntityBody that will hold a successful response message's entity body. Guzzle\Http\Message\RequestInterface
setScheme() Set the URI scheme of the request (http, https, ftp, etc) Guzzle\Http\Message\RequestInterface
setState() Set the state of the request Guzzle\Http\Message\RequestInterface
setUrl() Set the URL of the request Guzzle\Http\Message\RequestInterface
startResponse() The start of a response has been received for a request and the request is still in progress Guzzle\Http\Message\RequestInterface

Method Details

addPostFields() public abstract method

Add POST fields to use in the request

public abstract self addPostFields ( $fields )
$fields Guzzle\Http\QueryString|array

POST fields

addPostFile() public abstract method

Add a POST file to the upload

public abstract self addPostFile ( $field, $filename null, $contentType null, $postname null )
$field string

POST field to use (e.g. file). Used to reference content from the server.

$filename string

Full path to the file. Do not include the @ symbol.

$contentType string

Optional Content-Type to add to the Content-Disposition.

                       Default behavior is to guess. Set to false to not specify.
$postname string

The name of the file, when posted. (e.g. rename the file)

addPostFiles() public abstract method

Add POST files to use in the upload

public abstract self addPostFiles ( array $files )
$files array

An array of POST fields => filenames where filename can be a string or PostFileInterface

configureRedirects() public abstract method

Configure how redirects are handled for the request

public abstract self configureRedirects ( $strict false, $maxRedirects 5 )
$strict bool

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.
$maxRedirects int

Specify the maximum number of allowed redirects. Set to 0 to disable redirects.

getBody() public abstract method

Get the body of the request if set

public abstract Guzzle\Http\EntityBodyInterface|null getBody ( )
getPostField() public abstract method

Get a POST field from the request

public abstract mixed|null getPostField ( $field )
$field string

Field to retrieve

getPostFields() public abstract method

Get the post fields that will be used in the request

public abstract Guzzle\Http\QueryString getPostFields ( )
getPostFile() public abstract method

Get a POST file from the request

public abstract array|null getPostFile ( $fieldName )
$fieldName string

POST fields to retrieve

return array|null

Returns an array wrapping an array of PostFileInterface objects

getPostFiles() public abstract method

Returns an associative array of POST field names to PostFileInterface objects

public abstract array getPostFiles ( )
removePostField() public abstract method

Remove a POST field or file by name

public abstract self removePostField ( $field )
$field string

Name of the POST field or file to remove

removePostFile() public abstract method

Remove a POST file from the request

public abstract self removePostFile ( $fieldName )
$fieldName string

POST file field name to remove

setBody() public abstract method

Set the body of the request

public abstract self setBody ( $body, $contentType null )
$body string|resource|Guzzle\Http\EntityBodyInterface

Body to use in the entity body of the request

$contentType string

Content-Type to set. Leave null to use an existing

                                                    Content-Type or to guess the Content-Type
throws Guzzle\Http\Exception\RequestException

if the protocol is < 1.1 and Content-Length can not be determined

setPostField() public abstract method

Set a POST field value

public abstract self setPostField ( $key, $value )
$key string

Key to set

$value string

Value to set