Zend\Http\PhpEnvironment\Request
HTTP Request for current PHP environment
Synopsis
class Request
extends Request
{
- // Inherited constants from Request
- 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 $baseUrl;
- protected string $basePath;
- protected string $requestUri;
- protected ParametersInterface $serverParams;
- protected ParametersInterface $envParams;
- // Inherited members from Request
- 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 void __construct()
- public string getContent()
- public Request setCookies()
- public self setRequestUri()
- public string getRequestUri()
- public self setBaseUrl()
- public string getBaseUrl()
- public self setBasePath()
- public string getBasePath()
- public Request setServer()
- public ParametersInterface|mixed getServer()
- public Request setEnv()
- public ParametersInterface|mixed getEnv()
- protected array mapPhpFiles()
- protected void mapPhpFileParam()
- protected string detectRequestUri()
- protected string detectBaseUrl()
- protected string detectBasePath()
- // Inherited methods from Request
- 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
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
- $basePath
—
string
Base Path of the application. - $baseUrl
—
string
Base URL of the application. - $content — string
- $envParams
—
Zend\Stdlib\ParametersInterface
PHP environment params ($_ENV) - $fileParams — Zend\Stdlib\ParametersInterface
- $headers — Zend\Http\Headers|null
- $metadata — array
- $method — string
- $postParams — Zend\Stdlib\ParametersInterface
- $queryParams — Zend\Stdlib\ParametersInterface
- $requestUri
—
string
Actual request URI, independent of the platform. - $serverParams
—
Zend\Stdlib\ParametersInterface
PHP server params ($_SERVER) - $uri — Zend\Http\string|HttpUri
- $version — string
Methods
protected
- detectBasePath() — Autodetect the base path of the request
- detectBaseUrl() — Auto-detect the base path from the request environment
- detectRequestUri() — Detect the base URI for the request
- mapPhpFileParam()
- mapPhpFiles() — Convert PHP superglobal $_FILES into more sane parameter=value structure This handles form file input with brackets (name=files[])
public
- __construct() — Construct Instantiates request.
- getBasePath() — Get the base path.
- getBaseUrl() — Get the base URL.
- getContent() — Get raw request body
- getEnv() — Return the parameter container responsible for env parameters or a single parameter value.
- getRequestUri() — Get the request URI.
- getServer() — Return the parameter container responsible for server parameters or a single parameter value.
- setBasePath() — Set the base path.
- setBaseUrl() — Set the base URL.
- setCookies() — Set cookies
- setEnv() — Provide an alternate Parameter Container implementation for env parameters in this object, (this is NOT the primary API for value setting, for that see env())
- setRequestUri() — Set the request URI.
- setServer() — Provide an alternate Parameter Container implementation for server parameters in this object, (this is NOT the primary API for value setting, for that see getServer())
Inherited from Zend\Http\Request
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()