Zend\Http\Request
HTTP Request
Synopsis
class Request
extends AbstractMessage
implements
RequestInterface
{
- // constants
- const METHOD_OPTIONS = 'OPTIONS';
- const METHOD_GET = 'GET';
- const METHOD_HEAD = 'HEAD';
- const METHOD_POST = 'POST';
- const METHOD_PUT = 'PUT';
- const METHOD_DELETE = 'DELETE';
- const METHOD_TRACE = 'TRACE';
- const METHOD_CONNECT = 'CONNECT';
- const METHOD_PATCH = 'PATCH';
- const METHOD_PROPFIND = 'PROPFIND';
- // Inherited constants from AbstractMessage
- const VERSION_10 = '1.0';
- const VERSION_11 = '1.1';
- // members
- protected string $method;
- protected string|HttpUri $uri;
- protected ParametersInterface $queryParams;
- protected ParametersInterface $postParams;
- protected ParametersInterface $fileParams;
- // Inherited members from AbstractMessage
- protected string $version;
- protected Headers|null $headers;
- // methods
- public static Request fromString()
- public Request setMethod()
- public string getMethod()
- public Request setUri()
- public Http getUri()
- public string getUriString()
- public Request setQuery()
- public ParametersInterface|mixed getQuery()
- public Request setPost()
- public ParametersInterface|mixed getPost()
- public Cookie getCookie()
- public Request setFiles()
- public ParametersInterface|mixed getFiles()
- public ArrayIterator getHeaders()
- public ArrayIterator getHeader()
- public bool isOptions()
- public bool isPropFind()
- public bool isGet()
- public bool isHead()
- public bool isPost()
- public bool isPut()
- public bool isDelete()
- public bool isTrace()
- public bool isConnect()
- public bool isPatch()
- public bool isXmlHttpRequest()
- public bool isFlashRequest()
- public string renderRequestLine()
- public string toString()
- // Inherited methods from AbstractMessage
- public AbstractMessage setVersion()
- public string getVersion()
- public AbstractMessage setHeaders()
- public Headers getHeaders()
- public string __toString()
- // Inherited methods from Message
- public Message setMetadata()
- public mixed getMetadata()
- public Message setContent()
- public mixed getContent()
- public string toString()
Hierarchy
Extends
Extended by
Implements
Constants
Name | Value |
---|---|
METHOD_OPTIONS | 'OPTIONS' |
METHOD_GET | 'GET' |
METHOD_HEAD | 'HEAD' |
METHOD_POST | 'POST' |
METHOD_PUT | 'PUT' |
METHOD_DELETE | 'DELETE' |
METHOD_TRACE | 'TRACE' |
METHOD_CONNECT | 'CONNECT' |
METHOD_PATCH | 'PATCH' |
METHOD_PROPFIND | 'PROPFIND' |
VERSION_10 | '1.0' |
VERSION_11 | '1.1' |
Members
protected
- $content — string
- $fileParams — Zend\Stdlib\ParametersInterface
- $headers — Zend\Http\Headers|null
- $metadata — array
- $method — string
- $postParams — Zend\Stdlib\ParametersInterface
- $queryParams — Zend\Stdlib\ParametersInterface
- $uri — Zend\Http\string|HttpUri
- $version — string
Methods
public
- fromString() — A factory that produces a Request object from a well-formed Http Request string
- getCookie() — Return the Cookie header, this is the same as calling $request->getHeaders()->get('Cookie');
- getFiles() — Return the parameter container responsible for file parameters or a single file.
- getHeader() — Get all headers of a certain name/type.
- getHeaders() — Return the header container responsible for headers or all headers of a certain name/type
- getMethod() — Return the method for this request
- getPost() — Return the parameter container responsible for post parameters or a single post parameter.
- getQuery() — Return the parameter container responsible for query parameters or a single query parameter
- getUri() — Return the URI for this request object
- getUriString() — Return the URI for this request object as a string
- isConnect() — Is this a CONNECT method request?
- isDelete() — Is this a DELETE method request?
- isFlashRequest() — Is this a Flash request?
- isGet() — Is this a GET method request?
- isHead() — Is this a HEAD method request?
- isOptions() — Is this an OPTIONS method request?
- isPatch() — Is this a PATCH method request?
- isPost() — Is this a POST method request?
- isPropFind() — Is this a PROPFIND method request?
- isPut() — Is this a PUT method request?
- isTrace() — Is this a TRACE method request?
- isXmlHttpRequest() — Is the request a Javascript XMLHttpRequest?
- renderRequestLine() — Return the formatted request line (first line) for this http request
- setFiles() — Provide an alternate Parameter Container implementation for file parameters in this object, (this is NOT the primary API for value setting, for that see getFiles())
- setMethod() — Set the method for this request
- setPost() — Provide an alternate Parameter Container implementation for post parameters in this object, (this is NOT the primary API for value setting, for that see getPost())
- setQuery() — Provide an alternate Parameter Container implementation for query parameters in this object, (this is NOT the primary API for value setting, for that see getQuery())
- setUri() — Set the URI/URL for this request, this can be a string or an instance of Zend\Uri\Http
- toString()
Inherited from Zend\Http\AbstractMessage
public
- __toString() — Allow PHP casting of this object
- getHeaders() — Return the header container responsible for headers
- getVersion() — Return the HTTP version for this request
- setHeaders() — Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders())
- setVersion() — Set the HTTP version for this object, one of 1.0 or 1.1 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11)
Inherited from Zend\Stdlib\Message
public
- getContent() — Get message content
- getMetadata() — Retrieve all metadata or a single metadatum as specified by key
- setContent() — Set message content
- setMetadata() — Set message metadata
- toString()