Interface Guzzle\Http\Message\RequestInterface

ExtendsGuzzle\Common\HasDispatcherInterface, Guzzle\Http\Message\MessageInterface
Implemented byGuzzle\Http\Message\EntityEnclosingRequest, Guzzle\Http\Message\EntityEnclosingRequestInterface, Guzzle\Http\Message\Request

Generic HTTP request interface

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
addSubscriber() Add an event subscriber to the dispatcher Guzzle\Common\HasDispatcherInterface
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
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
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
send() Send the request Guzzle\Http\Message\RequestInterface
setAuth() Set HTTP authorization parameters Guzzle\Http\Message\RequestInterface
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
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

__toString() public abstract method

public abstract string __toString ( )
addCookie() public abstract method

Add a Cookie value by name to the Cookie header

public abstract self addCookie ( $name, $value )
$name string

Name of the cookie to add

$value string

Value to set

getClient() public abstract method

Get the client used to transport the request

public abstract Guzzle\Http\ClientInterface getClient ( )
return Guzzle\Http\ClientInterface

$client

getCookie() public abstract method

Get a cookie value by name

public abstract null|string getCookie ( $name )
$name string

Cookie to retrieve

getCookies() public abstract method

Get an array of Cookies

public abstract array getCookies ( )
getCurlOptions() public abstract method

Get the cURL options that will be applied when the cURL handle is created

public abstract Guzzle\Common\Collection getCurlOptions ( )
getHost() public abstract method

Get the host of the request

public abstract string getHost ( )
getMethod() public abstract method

Get the HTTP method of the request

public abstract string getMethod ( )
getPassword() public abstract method

Get the password to pass in the URL if set

public abstract string|null getPassword ( )
getPath() public abstract method

Get the path of the request (e.g. '/', '/index.html')

public abstract string getPath ( )
getPort() public abstract method

Get the port that the request will be sent on if it has been set

public abstract int|null getPort ( )
getProtocolVersion() public abstract method

Get the HTTP protocol version of the request

public abstract string getProtocolVersion ( )
getQuery() public abstract method

Get the collection of key value pairs that will be used as the query string in the request

public abstract Guzzle\Http\QueryString getQuery ( )
getResource() public abstract method

Get the resource part of the the request, including the path, query string, and fragment

public abstract string getResource ( )
getResponse() public abstract method

Get the previously received {@see Response} or NULL if the request has not been sent

public abstract Guzzle\Http\Message\Response|null getResponse ( )
getResponseBody() public abstract method

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.

public abstract Guzzle\Http\EntityBodyInterface getResponseBody ( )
getScheme() public abstract method

Get the URI scheme of the request (http, https, ftp, etc)

public abstract string getScheme ( )
getState() public abstract method

Get the state of the request. One of 'complete', 'transfer', 'new', 'error'

public abstract string getState ( )
getUrl() public abstract method

Get the full URL of the request (e.g. 'http://www.guzzle-project.com/')

public abstract string|Guzzle\Http\Url getUrl ( $asObject false )
$asObject bool

Set to TRUE to retrieve the URL as a clone of the URL object owned by the request.

getUsername() public abstract method

Get the username to pass in the URL if set

public abstract string|null getUsername ( )
removeCookie() public abstract method

Remove a specific cookie value by name

public abstract self removeCookie ( $name )
$name string

Cookie to remove by name

send() public abstract method

Send the request

public abstract Guzzle\Http\Message\Response send ( )
throws Guzzle\Http\Exception\RequestException

on a request error

setAuth() public abstract method

Set HTTP authorization parameters

public abstract self setAuth ( $user, $password '', $scheme 'Basic' )
$user string|bool

User name or false disable authentication

$password string

Password

$scheme string

Authentication scheme ('Basic', 'Digest', or a CURLAUTH_* constant (deprecated))

throws Guzzle\Http\Exception\RequestException
setClient() public abstract method

Set the client used to transport the request

public abstract self setClient ( Guzzle\Http\ClientInterface $client )
$client Guzzle\Http\ClientInterface
setHost() public abstract method

Set the host of the request. Including a port in the host will modify the port of the request.

public abstract self setHost ( $host )
$host string

Host to set (e.g. www.yahoo.com, www.yahoo.com:80)

setPath() public abstract method

Set the path of the request (e.g. '/', '/index.html')

public abstract self setPath ( $path )
$path string|array

Path to set or array of segments to implode

setPort() public abstract method

Set the port that the request will be sent on

public abstract self setPort ( $port )
$port int

Port number to set

setProtocolVersion() public abstract method

Set the HTTP protocol version of the request (e.g. 1.1 or 1.0)

public abstract self setProtocolVersion ( $protocol )
$protocol string

HTTP protocol version to use with the request

setResponse() public abstract method

Manually set a response for the request.

This method is useful for specifying a mock response for the request or setting the response using a cache. Manually setting a response will bypass the actual sending of a request.

public abstract self setResponse ( Guzzle\Http\Message\Response $response, $queued false )
$response Guzzle\Http\Message\Response

Response object to set

$queued bool

Set to TRUE to keep the request in a state of not having been sent, but queue the

                      response for send()
return self

Returns a reference to the object.

setResponseBody() public abstract method

Set the EntityBody that will hold a successful response message's entity body.

This method should be invoked when you need to send the response's entity body somewhere other than the normal php://temp buffer. For example, you can send the entity body to a socket, file, or some other custom stream.

public abstract Guzzle\Http\Message\Request setResponseBody ( $body )
$body Guzzle\Http\EntityBodyInterface|string|resource

Response body object. Pass a string to attempt to store the

                                             response body in a local file.
setScheme() public abstract method

Set the URI scheme of the request (http, https, ftp, etc)

public abstract self setScheme ( $scheme )
$scheme string

Scheme to set

setState() public abstract method

Set the state of the request

public abstract string setState ( $state, array $context = [] )
$state string

State of the request ('complete', 'transfer', 'new', 'error')

$context array

Contextual information about the state change

return string

Returns the current state of the request (which may have changed due to events being fired)

setUrl() public abstract method

Set the URL of the request

public abstract self setUrl ( $url )
$url
startResponse() public abstract method

The start of a response has been received for a request and the request is still in progress

public abstract self startResponse ( Guzzle\Http\Message\Response $response )
$response Guzzle\Http\Message\Response

Response that has been received so far