Open Journal Systems  3.3.0
Guzzle\Http\Message\RequestInterface Interface Reference
Inheritance diagram for Guzzle\Http\Message\RequestInterface:
Guzzle\Http\Message\MessageInterface Guzzle\Common\HasDispatcherInterface Guzzle\Http\Message\EntityEnclosingRequestInterface Guzzle\Http\Message\Request Guzzle\Http\Message\EntityEnclosingRequest Guzzle\Http\Message\EntityEnclosingRequest

Public Member Functions

 __toString ()
 
 addCookie ($name, $value)
 
 getClient ()
 
 getCookie ($name)
 
 getCookies ()
 
 getCurlOptions ()
 
 getHost ()
 
 getMethod ()
 
 getPassword ()
 
 getPath ()
 
 getPort ()
 
 getProtocolVersion ()
 
 getQuery ()
 
 getResource ()
 
 getResponse ()
 
 getResponseBody ()
 
 getScheme ()
 
 getState ()
 
 getUrl ($asObject=false)
 
 getUsername ()
 
 removeCookie ($name)
 
 send ()
 
 setAuth ($user, $password='', $scheme='Basic')
 
 setClient (ClientInterface $client)
 
 setHost ($host)
 
 setPath ($path)
 
 setPort ($port)
 
 setProtocolVersion ($protocol)
 
 setResponse (Response $response, $queued=false)
 
 setResponseBody ($body)
 
 setScheme ($scheme)
 
 setState ($state, array $context=array())
 
 setUrl ($url)
 
 startResponse (Response $response)
 
- Public Member Functions inherited from Guzzle\Http\Message\MessageInterface
 addHeader ($header, $value)
 
 addHeaders (array $headers)
 
 getHeader ($header)
 
 getHeaderLines ()
 
 getHeaders ()
 
 getParams ()
 
 getRawHeaders ()
 
 hasHeader ($header)
 
 removeHeader ($header)
 
 setHeader ($header, $value)
 
 setHeaders (array $headers)
 
- Public Member Functions inherited from Guzzle\Common\HasDispatcherInterface
 addSubscriber (EventSubscriberInterface $subscriber)
 
 dispatch ($eventName, array $context=array())
 
 getEventDispatcher ()
 
 setEventDispatcher (EventDispatcherInterface $eventDispatcher)
 

Data Fields

const CONNECT = 'CONNECT'
 
const DELETE = 'DELETE'
 
const GET = 'GET'
 
const HEAD = 'HEAD'
 
const OPTIONS = 'OPTIONS'
 
const PATCH = 'PATCH'
 
const POST = 'POST'
 
const PUT = 'PUT'
 
const STATE_COMPLETE = 'complete'
 
const STATE_ERROR = 'error'
 
const STATE_NEW = 'new'
 
const STATE_TRANSFER = 'transfer'
 
const TRACE = 'TRACE'
 

Additional Inherited Members

- Static Public Member Functions inherited from Guzzle\Common\HasDispatcherInterface
static getAllEvents ()
 

Detailed Description

Generic HTTP request interface

Definition at line 16 of file lib/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestInterface.php.

Member Function Documentation

◆ __toString()

Guzzle\Http\Message\RequestInterface::__toString ( )

◆ addCookie()

Guzzle\Http\Message\RequestInterface::addCookie (   $name,
  $value 
)

Add a Cookie value by name to the Cookie header

Parameters
string$nameName of the cookie to add
string$valueValue to set
Returns
self

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Http\Message\RequestFactory\visit_cookies().

◆ getClient()

Guzzle\Http\Message\RequestInterface::getClient ( )

Get the client used to transport the request

Returns
ClientInterface $client

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Http\Message\RequestFactory\cloneRequestWithMethod().

◆ getCookie()

Guzzle\Http\Message\RequestInterface::getCookie (   $name)

Get a cookie value by name

Parameters
string$nameCookie to retrieve
Returns
null|string

Implemented in Guzzle\Http\Message\Request.

◆ getCookies()

Guzzle\Http\Message\RequestInterface::getCookies ( )

Get an array of Cookies

Returns
array

Implemented in Guzzle\Http\Message\Request.

◆ getCurlOptions()

◆ getHost()

Guzzle\Http\Message\RequestInterface::getHost ( )

◆ getMethod()

◆ getPassword()

Guzzle\Http\Message\RequestInterface::getPassword ( )

Get the password to pass in the URL if set

Returns
string|null

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Stream\PhpStreamRequestFactory\setUrl().

◆ getPath()

Guzzle\Http\Message\RequestInterface::getPath ( )

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

Returns
string

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\getMatchingCookies().

◆ getPort()

Guzzle\Http\Message\RequestInterface::getPort ( )

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

Returns
int|null

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Http\Curl\CurlHandle\factory(), Guzzle\Log\MessageFormatter\format(), and Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\getMatchingCookies().

◆ getProtocolVersion()

Guzzle\Http\Message\RequestInterface::getProtocolVersion ( )

◆ getQuery()

Guzzle\Http\Message\RequestInterface::getQuery ( )

◆ getResource()

Guzzle\Http\Message\RequestInterface::getResource ( )

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

Returns
string

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Log\MessageFormatter\format().

◆ getResponse()

Guzzle\Http\Message\RequestInterface::getResponse ( )

Get the previously received {

See also
Response} or NULL if the request has not been sent
Returns
Response|null

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Plugin\History\HistoryPlugin\add(), and Guzzle\Http\Curl\CurlHandle\updateRequestFromTransfer().

◆ getResponseBody()

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.

Returns
EntityBodyInterface

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Http\RedirectPlugin\createRedirectRequest().

◆ getScheme()

Guzzle\Http\Message\RequestInterface::getScheme ( )

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

Returns
string

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar\getMatchingCookies().

◆ getState()

Guzzle\Http\Message\RequestInterface::getState ( )

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

Returns
string

Implemented in Guzzle\Http\Message\Request.

◆ getUrl()

◆ getUsername()

Guzzle\Http\Message\RequestInterface::getUsername ( )

Get the username to pass in the URL if set

Returns
string|null

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Stream\PhpStreamRequestFactory\setUrl().

◆ removeCookie()

Guzzle\Http\Message\RequestInterface::removeCookie (   $name)

Remove a specific cookie value by name

Parameters
string$nameCookie to remove by name
Returns
self

Implemented in Guzzle\Http\Message\Request.

◆ send()

Guzzle\Http\Message\RequestInterface::send ( )

Send the request

Returns
Response
Exceptions
RequestExceptionon a request error

Implemented in Guzzle\Http\Message\Request.

◆ setAuth()

Guzzle\Http\Message\RequestInterface::setAuth (   $user,
  $password = '',
  $scheme = 'Basic' 
)

Set HTTP authorization parameters

Parameters
string | bool$userUser name or false disable authentication
string$passwordPassword
string$schemeAuthentication scheme ('Basic', 'Digest', or a CURLAUTH_* constant (deprecated))
Returns
self http://php.net/manual/en/function.curl-setopt.php See the available options for CURLOPT_HTTPAUTH RequestException

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Http\Message\RequestFactory\visit_auth().

◆ setClient()

Guzzle\Http\Message\RequestInterface::setClient ( ClientInterface  $client)

Set the client used to transport the request

Parameters
ClientInterface$client
Returns
self

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Http\Client\prepareRequest().

◆ setHost()

Guzzle\Http\Message\RequestInterface::setHost (   $host)

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

Parameters
string$hostHost to set (e.g. www.yahoo.com, www.yahoo.com:80)
Returns
self

Implemented in Guzzle\Http\Message\Request.

◆ setPath()

Guzzle\Http\Message\RequestInterface::setPath (   $path)

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

Parameters
string | array$pathPath to set or array of segments to implode
Returns
self

Implemented in Guzzle\Http\Message\Request.

◆ setPort()

Guzzle\Http\Message\RequestInterface::setPort (   $port)

Set the port that the request will be sent on

Parameters
int$portPort number to set
Returns
self

Implemented in Guzzle\Http\Message\Request.

◆ setProtocolVersion()

Guzzle\Http\Message\RequestInterface::setProtocolVersion (   $protocol)

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

Parameters
string$protocolHTTP protocol version to use with the request
Returns
self

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Http\Curl\CurlHandle\updateRequestFromTransfer().

◆ setResponse()

Guzzle\Http\Message\RequestInterface::setResponse ( Response  $response,
  $queued = false 
)

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$responseResponse object to set
bool$queuedSet to TRUE to keep the request in a state of not having been sent, but queue the response for send()
Returns
self Returns a reference to the object.

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Plugin\Mock\MockPlugin\dequeue(), and Guzzle\Plugin\Cache\DefaultRevalidation\handle200Response().

◆ setResponseBody()

Guzzle\Http\Message\RequestInterface::setResponseBody (   $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
EntityBodyInterface | string | resource$bodyResponse body object. Pass a string to attempt to store the response body in a local file.
Returns
Request

Implemented in Guzzle\Http\Message\Request.

Referenced by Guzzle\Http\RedirectPlugin\createRedirectRequest(), Guzzle\Service\Command\LocationVisitor\Request\ResponseBodyVisitor\visit(), and Guzzle\Http\Message\RequestFactory\visit_save_to().

◆ setScheme()

Guzzle\Http\Message\RequestInterface::setScheme (   $scheme)

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

Parameters
string$schemeScheme to set
Returns
self

Implemented in Guzzle\Http\Message\Request.

◆ setState()

Guzzle\Http\Message\RequestInterface::setState (   $state,
array  $context = array() 
)

Set the state of the request

Parameters
string$stateState of the request ('complete', 'transfer', 'new', 'error')
array$contextContextual information about the state change
Returns
string Returns the current state of the request (which may have changed due to events being fired)

Implemented in Guzzle\Http\Message\Request, and Guzzle\Http\Message\EntityEnclosingRequest.

Referenced by Guzzle\Http\Curl\CurlMulti\beforeSend(), Guzzle\Plugin\Mock\MockPlugin\dequeue(), and Guzzle\Http\Curl\CurlMulti\processResponse().

◆ setUrl()

Guzzle\Http\Message\RequestInterface::setUrl (   $url)

Set the URL of the request

Parameters
string$url,|UrlFull URL to set including query string
Returns
self

Implemented in Guzzle\Http\Message\Request.

◆ startResponse()

Guzzle\Http\Message\RequestInterface::startResponse ( Response  $response)

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

Parameters
Response$responseResponse that has been received so far
Returns
self

Implemented in Guzzle\Http\Message\Request.

Field Documentation

◆ CONNECT

const Guzzle\Http\Message\RequestInterface::CONNECT = 'CONNECT'

◆ DELETE

const Guzzle\Http\Message\RequestInterface::DELETE = 'DELETE'

◆ GET

◆ HEAD

const Guzzle\Http\Message\RequestInterface::HEAD = 'HEAD'

◆ OPTIONS

const Guzzle\Http\Message\RequestInterface::OPTIONS = 'OPTIONS'

◆ PATCH

const Guzzle\Http\Message\RequestInterface::PATCH = 'PATCH'

◆ POST

const Guzzle\Http\Message\RequestInterface::POST = 'POST'

◆ PUT

const Guzzle\Http\Message\RequestInterface::PUT = 'PUT'

◆ STATE_COMPLETE

◆ STATE_ERROR

◆ STATE_NEW

◆ STATE_TRANSFER

◆ TRACE

const Guzzle\Http\Message\RequestInterface::TRACE = 'TRACE'

The documentation for this interface was generated from the following file: