Methods summary
public static
array
|
#
getAllEvents( )
Get a list of all of the events emitted from the class
Get a list of all of the events emitted from the class
Returns
array
Implementation of
|
public
|
#
__construct( string $method, string|Guzzle\Http\Url $url, array|Guzzle\Common\Collection $headers = array() )
Parameters
- $method
- HTTP method
- $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
- HTTP headers
Overrides
|
public
|
|
public
string
|
#
__toString( )
Get the HTTP request as a string
Get the HTTP request as a string
Returns
string
Implementation of
|
public static
|
#
onRequestError( Guzzle\Common\Event $event )
Default method that will throw exceptions if an unsuccessful response is received.
Default method that will throw exceptions if an unsuccessful response is received.
Parameters
Throws
|
public
Guzzle\Http\Message\Request
|
|
public
Guzzle\Http\ClientInterface
|
#
getClient( )
Get the client used to transport the request
Get the client used to transport the request
Returns
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setUrl( string $url )
Set the URL of the request
Set the URL of the request
Parameters
- $url
- $url|Url Full URL to set including query string
Returns
Implementation of
|
public
Guzzle\Http\Message\Response
|
#
send( )
Send the request
Returns
Throws
Implementation of
|
public
Guzzle\Http\Message\Response |null
|
|
public
QueryString
|
#
getQuery( $asString = false )
Get the collection of key value pairs that will be used as the query string in the request
Get the collection of key value pairs that will be used as the query string in the request
Returns
QueryString
Implementation of
|
public
string
|
#
getMethod( )
Get the HTTP method of the request
Get the HTTP method of the request
Returns
string
Implementation of
|
public
string
|
#
getScheme( )
Get the URI scheme of the request (http, https, ftp, etc)
Get the URI scheme of the request (http, https, ftp, etc)
Returns
string
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setScheme( string $scheme )
Set the URI scheme of the request (http, https, ftp, etc)
Set the URI scheme of the request (http, https, ftp, etc)
Parameters
Returns
Implementation of
|
public
string
|
#
getHost( )
Get the host of the request
Get the host of the request
Returns
string
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setHost( string $host )
Set the host of the request. Including a port in the host will modify the port of the request.
Set the host of the request. Including a port in the host will modify the port of the request.
Parameters
- $host
- Host to set (e.g. www.yahoo.com, www.yahoo.com:80)
Returns
Implementation of
|
public
string
|
#
getProtocolVersion( )
Get the HTTP protocol version of the request
Get the HTTP protocol version of the request
Returns
string
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setProtocolVersion( string $protocol )
Set the HTTP protocol version of the request (e.g. 1.1 or 1.0)
Set the HTTP protocol version of the request (e.g. 1.1 or 1.0)
Parameters
- $protocol
- HTTP protocol version to use with the request
Returns
Implementation of
|
public
string
|
#
getPath( )
Get the path of the request (e.g. '/', '/index.html')
Get the path of the request (e.g. '/', '/index.html')
Returns
string
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setPath( string|array $path )
Set the path of the request (e.g. '/', '/index.html')
Set the path of the request (e.g. '/', '/index.html')
Parameters
- $path
- Path to set or array of segments to implode
Returns
Implementation of
|
public
integer|null
|
#
getPort( )
Get the port that the request will be sent on if it has been set
Get the port that the request will be sent on if it has been set
Returns
integer|null
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setPort( integer $port )
Set the port that the request will be sent on
Set the port that the request will be sent on
Parameters
Returns
Implementation of
|
public
string|null
|
#
getUsername( )
Get the username to pass in the URL if set
Get the username to pass in the URL if set
Returns
string|null
Implementation of
|
public
string|null
|
#
getPassword( )
Get the password to pass in the URL if set
Get the password to pass in the URL if set
Returns
string|null
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setAuth( string|boolean $user, string $password = '', string $scheme = CURLAUTH_BASIC )
Set HTTP authorization parameters
Set HTTP authorization parameters
Parameters
- $user
- User name or false disable authentication
- $password
- Password
- $scheme
- Authentication scheme ('Basic', 'Digest', or a CURLAUTH_* constant (deprecated))
Returns
Throws
Link
Implementation of
|
public
string
|
#
getResource( )
Get the resource part of the the request, including the path, query string, and fragment
Get the resource part of the the request, including the path, query string, and fragment
Returns
string
Implementation of
|
public
string|Guzzle\Http\Url
|
#
getUrl( boolean $asObject = false )
Get the full URL of the request (e.g. 'http://www.guzzle-project.com/')
Get the full URL of the request (e.g. 'http://www.guzzle-project.com/')
Parameters
- $asObject
- Set to TRUE to retrieve the URL as a clone of the URL object owned by the request.
Returns
Implementation of
|
public
string
|
#
getState( )
Get the state of the request. One of 'complete', 'transfer', 'new', 'error'
Get the state of the request. One of 'complete', 'transfer', 'new', 'error'
Returns
string
Implementation of
|
public
string
|
#
setState( string $state, array $context = array() )
Set the state of the request
Set the state of the request
Parameters
- $state
- State of the request ('complete', 'transfer', 'new', 'error')
- $context
- Contextual information about the state change
Returns
string Returns the current state of the request (which may have changed due to events being fired)
Implementation of
|
public
Guzzle\Common\Collection
|
#
getCurlOptions( )
Get the cURL options that will be applied when the cURL handle is created
Get the cURL options that will be applied when the cURL handle is created
Returns
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
startResponse( Guzzle\Http\Message\Response $response )
The start of a response has been received for a request and the request is still in progress
The start of a response has been received for a request and the request is still in progress
Parameters
- $response
- Response that has been received so far
Returns
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setResponse( Guzzle\Http\Message\Response $response, boolean $queued = false )
Manually set a response for the request.
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.
Parameters
- $response
- Response object to set
- $queued
Set to TRUE to keep the request in a state of not having been sent, but queue the
response for send()
Returns
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setResponseBody( Guzzle\Http\EntityBodyInterface |string|resource $body )
Set the EntityBody that will hold a successful response message's entity body.
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.
Parameters
- $body
Response body object. Pass a string to attempt to store the
response body in a local file.
Returns
Implementation of
|
public
Guzzle\Http\EntityBodyInterface
|
#
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.
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.
Returns
Implementation of
|
public
boolean
|
#
isResponseBodyRepeatable( )
Determine if the response body is repeatable (readable + seekable)
Determine if the response body is repeatable (readable + seekable)
Deprecated
Use getResponseBody()->isSeekable()
Returns
boolean
Codecoverageignore
|
public
array
|
#
getCookies( )
Get an array of Cookies
Returns
array
Implementation of
|
public
null|string
|
#
getCookie( string $name )
Get a cookie value by name
Get a cookie value by name
Parameters
Returns
null|string
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
addCookie( string $name, string $value )
Add a Cookie value by name to the Cookie header
Add a Cookie value by name to the Cookie header
Parameters
- $name
- Name of the cookie to add
- $value
- Value to set
Returns
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
removeCookie( string $name )
Remove a specific cookie value by name
Remove a specific cookie value by name
Parameters
- $name
- Cookie to remove by name
Returns
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
setEventDispatcher( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher )
Set the EventDispatcher of the request
Set the EventDispatcher of the request
Parameters
Returns
Implementation of
|
public
Symfony\Component\EventDispatcher\EventDispatcherInterface
|
#
getEventDispatcher( )
Get the EventDispatcher of the request
Get the EventDispatcher of the request
Returns
Symfony\Component\EventDispatcher\EventDispatcherInterface
Implementation of
|
public
Guzzle\Common\Event
|
#
dispatch( string $eventName, array $context = array() )
Helper to dispatch Guzzle events and set the event name on the event
Helper to dispatch Guzzle events and set the event name on the event
Parameters
- $eventName
- Name of the event to dispatch
- $context
- Context of the event
Returns
Implementation of
|
public
Guzzle\Http\Message\Request
|
#
addSubscriber( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )
Add an event subscriber to the dispatcher
Add an event subscriber to the dispatcher
Parameters
- $subscriber
- Event subscriber
Returns
Implementation of
|
protected
array
|
#
getEventArray( )
Get an array containing the request and response for event notifications
Get an array containing the request and response for event notifications
Returns
array
|
protected
|
#
processResponse( array $context = array() )
Process a received response
Process a received response
Parameters
- $context
- Contextual information
Throws
|
public
|
#
canCache( )
Deprecated
Use Guzzle\Plugin\Cache\DefaultCanCacheStrategy
Codecoverageignore
|
public
|
#
setIsRedirect( $isRedirect )
Deprecated
Use the history plugin (not emitting a warning as this is built-into the RedirectPlugin for now)
Codecoverageignore
|
public
|
#
isRedirect( )
Deprecated
Use the history plugin
Codecoverageignore
|