Methods summary
public
string
|
#
__toString( )
Get the HTTP request as a string
Get the HTTP request as a string
Returns
string
|
public
Guzzle\Http\Message\RequestInterface
|
|
public
Guzzle\Http\ClientInterface
|
#
getClient( )
Get the client used to transport the request
Get the client used to transport the request
Returns
|
public
Guzzle\Http\Message\RequestInterface
|
#
setUrl( string $url )
Set the URL of the request
Set the URL of the request
Warning: Calling this method will modify headers, rewrite the query string
object, and set other data associated with the request.
Parameters
- $url
string $url|Url Full URL to set including query string
Returns
|
public
Guzzle\Http\Message\Response
|
#
send( )
Send the request
Returns
Throws
|
public
Guzzle\Http\Message\Response |null
|
|
public
Guzzle\Http\QueryString
|
#
getQuery( )
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
|
public
string
|
#
getMethod( )
Get the HTTP method of the request
Get the HTTP method of the request
Returns
string
|
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
|
public
Guzzle\Http\Message\RequestInterface
|
#
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
- $scheme
string $scheme Scheme to set
Returns
|
public
string
|
#
getHost( )
Get the host of the request
Get the host of the request
Returns
string
|
public
Guzzle\Http\Message\RequestInterface
|
#
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
Returns
|
public
string
|
#
getProtocolVersion( )
Get the HTTP protocol version of the request
Get the HTTP protocol version of the request
Returns
string
|
public
Guzzle\Http\Message\RequestInterface
|
#
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
string $protocol HTTP protocol version to use with the request
Returns
|
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
|
public
Guzzle\Http\Message\RequestInterface
|
#
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
string|array $path Path to set or array of segments to implode
Returns
|
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
|
public
Guzzle\Http\Message\RequestInterface
|
#
setPort( integer $port )
Set the port that the request will be sent on
Set the port that the request will be sent on
Parameters
- $port
integer $port Port number to set
Returns
|
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
|
public
Guzzle\Http\Message\Request
|
#
setAuth( string|boolean $user, string $password = '', string $scheme = 'Basic' )
Set HTTP authorization parameters
Set HTTP authorization parameters
Parameters
- $user
string|boolean $user User name or false disable authentication
- $password
string $password Password
- $scheme
string $scheme Authentication scheme to use (CURLAUTH_BASIC, CURLAUTH_DIGEST, etc)
Returns
Throws
Link
|
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
|
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
|
public
string|Guzzle\Http\Url
|
#
getUrl( boolean $asObject = false )
Get the full URL of the request (e.g. 'http://www.guzzle-project.com/')
scheme://username:password@domain:port/path?query_string#fragment
Get the full URL of the request (e.g. 'http://www.guzzle-project.com/')
scheme://username:password@domain:port/path?query_string#fragment
Parameters
- $asObject
boolean $asObject Set to TRUE to retrieve the URL as a clone of the URL object owned by
the request.
Returns
|
public
string
|
#
getState( )
Get the state of the request. One of 'complete', 'sending', 'new'
Get the state of the request. One of 'complete', 'sending', 'new'
Returns
string
|
public
Guzzle\Http\Message\RequestInterface
|
#
setState( string $state, array $context = array() )
Set the state of the request
Set the state of the request
Parameters
- $state
string $state State of the request (complete, sending, or new)
- $context
array $context Contextual information about the state change
Returns
|
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
|
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
Returns
|
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
|
public
boolean
|
#
isResponseBodyRepeatable( )
Determine if the response body is repeatable (readable + seekable)
Determine if the response body is repeatable (readable + seekable)
Returns
boolean
|
public
Guzzle\Http\Message\RequestInterface
|
#
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
Guzzle\Http\Message\Response
$response Response object to set
- $queued
boolean $queued Set to TRUE to keep the request in a state of not having been sent, but
queue the response for send()
Returns
|
public
array
|
|
public
null|string
|
#
getCookie( string $name )
Get a cookie value by name
Get a cookie value by name
Parameters
- $name
string $name Cookie to retrieve
Returns
null|string
|
public
Guzzle\Http\Message\RequestInterface
|
#
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
string $name Name of the cookie to add
- $value
string $value Value to set
Returns
|
public
Guzzle\Http\Message\RequestInterface
|
#
removeCookie( string $name )
Remove a specific cookie value by name
Remove a specific cookie value by name
Parameters
- $name
string $name Cookie to remove by name
Returns
|
public
boolean
|
#
canCache( )
Returns whether or not the request can be cached
Returns whether or not the request can be cached
Returns
boolean
|
public
Guzzle\Http\Message\RequestInterface
|
#
setIsRedirect( boolean $isRedirect )
Set whether or not the request is a request that resulted from a redirect
Set whether or not the request is a request that resulted from a redirect
Parameters
- $isRedirect
boolean $isRedirect
Returns
|
public
boolean
|
#
isRedirect( )
Check whether or not the request is a request that resulted from a
redirect
Check whether or not the request is a request that resulted from a
redirect
Returns
boolean
|