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

Public Member Functions

 __construct ($method, $url, $headers=array())
 
 __toString ()
 
 addPostFields ($fields)
 
 addPostFile ($field, $filename=null, $contentType=null, $postname=null)
 
 addPostFiles (array $files)
 
 configureRedirects ($strict=false, $maxRedirects=5)
 
 getBody ()
 
 getPostField ($field)
 
 getPostFields ()
 
 getPostFile ($fieldName)
 
 getPostFiles ()
 
 removePostField ($field)
 
 removePostFile ($fieldName)
 
 setBody ($body, $contentType=null)
 
 setExpectHeaderCutoff ($size)
 
 setPostField ($key, $value)
 
 setState ($state, array $context=array())
 
- Public Member Functions inherited from Guzzle\Http\Message\Request
 __clone ()
 
 addCookie ($name, $value)
 
 addSubscriber (EventSubscriberInterface $subscriber)
 
 canCache ()
 
 dispatch ($eventName, array $context=array())
 
 getClient ()
 
 getCookie ($name)
 
 getCookies ()
 
 getCurlOptions ()
 
 getEventDispatcher ()
 
 getHost ()
 
 getMethod ()
 
 getPassword ()
 
 getPath ()
 
 getPort ()
 
 getProtocolVersion ()
 
 getQuery ($asString=false)
 
 getRawHeaders ()
 
 getResource ()
 
 getResponse ()
 
 getResponseBody ()
 
 getScheme ()
 
 getState ()
 
 getUrl ($asObject=false)
 
 getUsername ()
 
 isRedirect ()
 
 isResponseBodyRepeatable ()
 
 removeCookie ($name)
 
 send ()
 
 setAuth ($user, $password='', $scheme=CURLAUTH_BASIC)
 
 setClient (ClientInterface $client)
 
 setEventDispatcher (EventDispatcherInterface $eventDispatcher)
 
 setHost ($host)
 
 setIsRedirect ($isRedirect)
 
 setPath ($path)
 
 setPort ($port)
 
 setProtocolVersion ($protocol)
 
 setResponse (Response $response, $queued=false)
 
 setResponseBody ($body)
 
 setScheme ($scheme)
 
 setUrl ($url)
 
 startResponse (Response $response)
 
- Public Member Functions inherited from Guzzle\Http\Message\AbstractMessage
 __construct ()
 
 addCacheControlDirective ($directive, $value=true)
 
 addHeader ($header, $value)
 
 addHeaders (array $headers)
 
 getCacheControlDirective ($directive)
 
 getHeader ($header)
 
 getHeaderLines ()
 
 getHeaders ()
 
 getParams ()
 
 getTokenizedHeader ($header, $token=';')
 
 hasCacheControlDirective ($directive)
 
 hasHeader ($header)
 
 removeCacheControlDirective ($directive)
 
 removeHeader ($header)
 
 setHeader ($header, $value)
 
 setHeaderFactory (HeaderFactoryInterface $factory)
 
 setHeaders (array $headers)
 
 setTokenizedHeader ($header, $data, $token=';')
 
- Public Member Functions inherited from Guzzle\Http\Message\RequestInterface
 getQuery ()
 

Protected Member Functions

 processPostFields ()
 
- Protected Member Functions inherited from Guzzle\Http\Message\Request
 getEventArray ()
 
 processResponse (array $context=array())
 

Protected Attributes

 $body
 
 $expectCutoff = 1048576
 
 $postFields
 
 $postFiles = array()
 
- Protected Attributes inherited from Guzzle\Http\Message\Request
 $client
 
 $curlOptions
 
 $eventDispatcher
 
 $isRedirect = false
 
 $method
 
 $password
 
 $response
 
 $responseBody
 
 $state
 
 $url
 
 $username
 
- Protected Attributes inherited from Guzzle\Http\Message\AbstractMessage
 $headerFactory
 
 $headers
 
 $params
 
 $protocol = 'HTTP'
 
 $protocolVersion = '1.1'
 

Additional Inherited Members

- Static Public Member Functions inherited from Guzzle\Http\Message\Request
static getAllEvents ()
 
static onRequestError (Event $event)
 
- Data Fields inherited from Guzzle\Http\Message\RequestInterface
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'
 
- Data Fields inherited from Guzzle\Http\Message\EntityEnclosingRequestInterface
const MULTIPART = 'multipart/form-data'
 
const URL_ENCODED = 'application/x-www-form-urlencoded; charset=utf-8'
 

Detailed Description

HTTP request that sends an entity-body in the request message (POST, PUT, PATCH, DELETE)

Definition at line 14 of file EntityEnclosingRequest.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Http\Message\EntityEnclosingRequest::__construct (   $method,
  $url,
  $headers = array() 
)
Parameters
string$methodHTTP method
string | Url$urlHTTP 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.
array | Collection$headersHTTP headers

Reimplemented from Guzzle\Http\Message\Request.

Definition at line 40 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\AbstractMessage\$headers, Guzzle\Http\Message\Request\$method, and Guzzle\Http\Message\Request\$url.

Member Function Documentation

◆ __toString()

Guzzle\Http\Message\EntityEnclosingRequest::__toString ( )
Returns
string

Reimplemented from Guzzle\Http\Message\Request.

Definition at line 49 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\$body.

◆ addPostFields()

Guzzle\Http\Message\EntityEnclosingRequest::addPostFields (   $fields)

Add POST fields to use in the request

Parameters
QueryString | array$fieldsPOST fields
Returns
self

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 161 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\processPostFields().

◆ addPostFile()

Guzzle\Http\Message\EntityEnclosingRequest::addPostFile (   $field,
  $filename = null,
  $contentType = null,
  $postname = null 
)

Add a POST file to the upload

Parameters
string$fieldPOST field to use (e.g. file). Used to reference content from the server.
string$filenameFull path to the file. Do not include the @ symbol.
string$contentTypeOptional Content-Type to add to the Content-Disposition. Default behavior is to guess. Set to false to not specify.
string$postnameThe name of the file, when posted. (e.g. rename the file)
Returns
self

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 195 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\processPostFields().

Referenced by Guzzle\Http\Message\EntityEnclosingRequest\addPostFiles().

◆ addPostFiles()

Guzzle\Http\Message\EntityEnclosingRequest::addPostFiles ( array  $files)

Add POST files to use in the upload

Parameters
array$filesAn array of POST fields => filenames where filename can be a string or PostFileInterface
Returns
self

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 226 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\addPostFile().

◆ configureRedirects()

Guzzle\Http\Message\EntityEnclosingRequest::configureRedirects (   $strict = false,
  $maxRedirects = 5 
)

Configure how redirects are handled for the request

Parameters
bool$strictSet to true to follow strict RFC compliance when redirecting POST requests. Most browsers with follow a 301-302 redirect for a POST request with a GET request. This is the default behavior of Guzzle. Enable strict redirects to redirect these responses with a POST rather than a GET request.
int$maxRedirectsSpecify the maximum number of allowed redirects. Set to 0 to disable redirects.
Returns
self

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 131 of file EntityEnclosingRequest.php.

References Guzzle\Http\RedirectPlugin\DISABLE, Guzzle\Http\Message\AbstractMessage\getParams(), Guzzle\Http\RedirectPlugin\MAX_REDIRECTS, and Guzzle\Http\RedirectPlugin\STRICT_REDIRECTS.

◆ getBody()

Guzzle\Http\Message\EntityEnclosingRequest::getBody ( )

Get the body of the request if set

Returns
EntityBodyInterface|null

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 107 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\$body.

◆ getPostField()

Guzzle\Http\Message\EntityEnclosingRequest::getPostField (   $field)

Get a POST field from the request

Parameters
string$fieldField to retrieve
Returns
mixed|null

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 143 of file EntityEnclosingRequest.php.

◆ getPostFields()

Guzzle\Http\Message\EntityEnclosingRequest::getPostFields ( )

Get the post fields that will be used in the request

Returns
QueryString

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 148 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\$postFields.

◆ getPostFile()

Guzzle\Http\Message\EntityEnclosingRequest::getPostFile (   $fieldName)

Get a POST file from the request

Parameters
string$fieldNamePOST fields to retrieve
Returns
array|null Returns an array wrapping an array of PostFileInterface objects

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 182 of file EntityEnclosingRequest.php.

◆ getPostFiles()

Guzzle\Http\Message\EntityEnclosingRequest::getPostFiles ( )

Returns an associative array of POST field names to PostFileInterface objects

Returns
array

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 177 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\$postFiles.

◆ processPostFields()

◆ removePostField()

Guzzle\Http\Message\EntityEnclosingRequest::removePostField (   $field)

Remove a POST field or file by name

Parameters
string$fieldName of the POST field or file to remove
Returns
self

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 169 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\processPostFields().

◆ removePostFile()

Guzzle\Http\Message\EntityEnclosingRequest::removePostFile (   $fieldName)

Remove a POST file from the request

Parameters
string$fieldNamePOST file field name to remove
Returns
self

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 187 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\processPostFields().

◆ setBody()

Guzzle\Http\Message\EntityEnclosingRequest::setBody (   $body,
  $contentType = null 
)

Set the body of the request

Parameters
string | resource | EntityBodyInterface$bodyBody to use in the entity body of the request
string$contentTypeContent-Type to set. Leave null to use an existing Content-Type or to guess the Content-Type
Returns
self
Exceptions
RequestExceptionif the protocol is < 1.1 and Content-Length can not be determined

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 69 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\$body, Guzzle\Http\EntityBody\factory(), Guzzle\Http\Message\AbstractMessage\hasHeader(), and Guzzle\Http\Message\AbstractMessage\setHeader().

◆ setExpectHeaderCutoff()

Guzzle\Http\Message\EntityEnclosingRequest::setExpectHeaderCutoff (   $size)

Set the size that the entity body of the request must exceed before adding the Expect: 100-Continue header.

Parameters
int | bool$sizeCutoff in bytes. Set to false to never send the expect header (even with non-seekable data)
Returns
self

Definition at line 119 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\AbstractMessage\removeHeader(), and Guzzle\Http\Message\AbstractMessage\setHeader().

◆ setPostField()

Guzzle\Http\Message\EntityEnclosingRequest::setPostField (   $key,
  $value 
)

Set a POST field value

Parameters
string$keyKey to set
string$valueValue to set
Returns
self

Implements Guzzle\Http\Message\EntityEnclosingRequestInterface.

Definition at line 153 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\EntityEnclosingRequest\processPostFields().

◆ setState()

Guzzle\Http\Message\EntityEnclosingRequest::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)

Reimplemented from Guzzle\Http\Message\Request.

Definition at line 59 of file EntityEnclosingRequest.php.

References Guzzle\Http\Message\Request\$state, and Guzzle\Http\Message\AbstractMessage\setHeader().

Field Documentation

◆ $body

EntityBodyInterface Guzzle\Http\Message\EntityEnclosingRequest::$body
protected

◆ $expectCutoff

int Guzzle\Http\Message\EntityEnclosingRequest::$expectCutoff = 1048576
protected

When the size of the body is greater than 1MB, then send Expect: 100-Continue

Definition at line 20 of file EntityEnclosingRequest.php.

◆ $postFields

QueryString Guzzle\Http\Message\EntityEnclosingRequest::$postFields
protected

POST fields to use in the EntityBody

Definition at line 32 of file EntityEnclosingRequest.php.

Referenced by Guzzle\Http\Message\EntityEnclosingRequest\getPostFields().

◆ $postFiles

array Guzzle\Http\Message\EntityEnclosingRequest::$postFiles = array()
protected

POST files to send with the request

Definition at line 38 of file EntityEnclosingRequest.php.

Referenced by Guzzle\Http\Message\EntityEnclosingRequest\getPostFiles().


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