Class Guzzle\Http\Message\Request

InheritanceGuzzle\Http\Message\Request » Guzzle\Http\Message\AbstractMessage
ImplementsGuzzle\Http\Message\MessageInterface, Guzzle\Http\Message\RequestInterface
SubclassesGuzzle\Http\Message\EntityEnclosingRequest

HTTP request class to send requests

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__clone() Guzzle\Http\Message\Request
__construct() Guzzle\Http\Message\Request
__toString() Get the HTTP request as a string Guzzle\Http\Message\Request
addCacheControlDirective() Guzzle\Http\Message\AbstractMessage
addCookie() Guzzle\Http\Message\Request
addHeader() Guzzle\Http\Message\AbstractMessage
addHeaders() Guzzle\Http\Message\AbstractMessage
addSubscriber() Guzzle\Http\Message\Request
canCache() Guzzle\Http\Message\Request
dispatch() Guzzle\Http\Message\Request
getAllEvents() Guzzle\Http\Message\Request
getCacheControlDirective() Guzzle\Http\Message\AbstractMessage
getClient() Guzzle\Http\Message\Request
getCookie() Guzzle\Http\Message\Request
getCookies() Guzzle\Http\Message\Request
getCurlOptions() Guzzle\Http\Message\Request
getEventDispatcher() Guzzle\Http\Message\Request
getHeader() Guzzle\Http\Message\AbstractMessage
getHeaderLines() Guzzle\Http\Message\AbstractMessage
getHeaders() Guzzle\Http\Message\AbstractMessage
getHost() Guzzle\Http\Message\Request
getMethod() Guzzle\Http\Message\Request
getParams() Guzzle\Http\Message\AbstractMessage
getPassword() Guzzle\Http\Message\Request
getPath() Guzzle\Http\Message\Request
getPort() Guzzle\Http\Message\Request
getProtocolVersion() Guzzle\Http\Message\Request
getQuery() Guzzle\Http\Message\Request
getRawHeaders() Guzzle\Http\Message\Request
getResource() Guzzle\Http\Message\Request
getResponse() Guzzle\Http\Message\Request
getResponseBody() Guzzle\Http\Message\Request
getScheme() Guzzle\Http\Message\Request
getState() Guzzle\Http\Message\Request
getTokenizedHeader() Guzzle\Http\Message\AbstractMessage
getUrl() Guzzle\Http\Message\Request
getUsername() Guzzle\Http\Message\Request
hasCacheControlDirective() Guzzle\Http\Message\AbstractMessage
hasHeader() Guzzle\Http\Message\AbstractMessage
isRedirect() Guzzle\Http\Message\Request
isResponseBodyRepeatable() Determine if the response body is repeatable (readable + seekable) Guzzle\Http\Message\Request
onRequestError() Default method that will throw exceptions if an unsuccessful response is received. Guzzle\Http\Message\Request
removeCacheControlDirective() Guzzle\Http\Message\AbstractMessage
removeCookie() Guzzle\Http\Message\Request
removeHeader() Guzzle\Http\Message\AbstractMessage
send() Guzzle\Http\Message\Request
setAuth() Guzzle\Http\Message\Request
setClient() Guzzle\Http\Message\Request
setEventDispatcher() Guzzle\Http\Message\Request
setHeader() Guzzle\Http\Message\AbstractMessage
setHeaderFactory() Set the header factory to use to create headers Guzzle\Http\Message\AbstractMessage
setHeaders() Guzzle\Http\Message\AbstractMessage
setHost() Guzzle\Http\Message\Request
setIsRedirect() Guzzle\Http\Message\Request
setPath() Guzzle\Http\Message\Request
setPort() Guzzle\Http\Message\Request
setProtocolVersion() Guzzle\Http\Message\Request
setResponse() Guzzle\Http\Message\Request
setResponseBody() Guzzle\Http\Message\Request
setScheme() Guzzle\Http\Message\Request
setState() Guzzle\Http\Message\Request
setTokenizedHeader() Guzzle\Http\Message\AbstractMessage
setUrl() Guzzle\Http\Message\Request
startResponse() Guzzle\Http\Message\Request

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getEventArray() Get an array containing the request and response for event notifications Guzzle\Http\Message\Request
processResponse() Process a received response Guzzle\Http\Message\Request

Property Details

$client protected property
$curlOptions protected property

CURL specific transfer options

$eventDispatcher protected property
$isRedirect protected property
protected bool $isRedirect false
$method protected property

HTTP method (GET, PUT, POST, DELETE, HEAD, OPTIONS, TRACE)

protected string $method null
$password protected property

Auth password

protected string $password null
$response protected property

Response of the request

$responseBody protected property

Response body

$state protected property

State of the request object

protected string $state null
$url protected property

HTTP Url

protected Guzzle\Http\Url $url null
$username protected property

Authentication username

protected string $username null

Method Details

__clone() public method

public void __clone ( )
__construct() public method

public void __construct ( $method, $url, $headers = [] )
$method string

HTTP method

$url string|Guzzle\Http\Url

HTTP URL to connect to. The URI scheme, host header, and URI are parsed from the

                             full URL. If query string parameters are present they will be parsed as well.
$headers array|Guzzle\Common\Collection

HTTP headers

__toString() public method

Get the HTTP request as a string

public string __toString ( )
addCookie() public method

public void addCookie ( $name, $value )
$name
$value
addSubscriber() public method

public void addSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )
$subscriber
canCache() public method

public void canCache ( )
dispatch() public method

public void dispatch ( $eventName, array $context = [] )
$eventName
$context
getAllEvents() public static method

public static void getAllEvents ( )
getClient() public method

public void getClient ( )
getCookie() public method

public void getCookie ( $name )
$name
getCookies() public method

public void getCookies ( )
getCurlOptions() public method

public void getCurlOptions ( )
getEventArray() protected method

Get an array containing the request and response for event notifications

protected array getEventArray ( )
getEventDispatcher() public method

public void getEventDispatcher ( )
getHost() public method

public void getHost ( )
getMethod() public method

public void getMethod ( )
getPassword() public method

public void getPassword ( )
getPath() public method

public void getPath ( )
getPort() public method

public void getPort ( )
getProtocolVersion() public method

public void getProtocolVersion ( )
getQuery() public method

public void getQuery ( $asString false )
$asString
getRawHeaders() public method

public void getRawHeaders ( )
getResource() public method

public void getResource ( )
getResponse() public method

public void getResponse ( )
getResponseBody() public method

public void getResponseBody ( )
getScheme() public method

public void getScheme ( )
getState() public method

public void getState ( )
getUrl() public method

public void getUrl ( $asObject false )
$asObject
getUsername() public method

public void getUsername ( )
isRedirect() public method

public void isRedirect ( )
isResponseBodyRepeatable() public method

Determine if the response body is repeatable (readable + seekable)

public bool isResponseBodyRepeatable ( )
onRequestError() public static method

Default method that will throw exceptions if an unsuccessful response is received.

public static void onRequestError ( Guzzle\Common\Event $event )
$event Guzzle\Common\Event

Received

throws Guzzle\Http\Exception\BadResponseException

if the response is not successful

processResponse() protected method

Process a received response

protected void processResponse ( array $context = [] )
$context array

Contextual information

throws \Guzzle\Http\Exception\RequestException|\Guzzle\Http\Exception\BadResponseException

on unsuccessful responses

removeCookie() public method

public void removeCookie ( $name )
$name
send() public method

public void send ( )
setAuth() public method

public void setAuth ( $user, $password '', $scheme CURLAUTH_BASIC )
$user
$password
$scheme
setClient() public method

public void setClient ( Guzzle\Http\ClientInterface $client )
$client
setEventDispatcher() public method

public void setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher )
$eventDispatcher
setHost() public method

public void setHost ( $host )
$host
setIsRedirect() public method

public void setIsRedirect ( $isRedirect )
$isRedirect
setPath() public method

public void setPath ( $path )
$path
setPort() public method

public void setPort ( $port )
$port
setProtocolVersion() public method

public void setProtocolVersion ( $protocol )
$protocol
setResponse() public method

public void setResponse ( Guzzle\Http\Message\Response $response, $queued false )
$response
$queued
setResponseBody() public method

public void setResponseBody ( $body )
$body
setScheme() public method

public void setScheme ( $scheme )
$scheme
setState() public method

public void setState ( $state, array $context = [] )
$state
$context
setUrl() public method

public void setUrl ( $url )
$url
startResponse() public method

public void startResponse ( Guzzle\Http\Message\Response $response )
$response