Request::getContent()

string getContent() Gets the request raw body data. Return Value string The request raw body data

Request::getClientIps()

array getClientIps() Returns the client IP addresses. In the returned array the most trusted IP address is first, and the least trusted one last. The "real" client IP address is the last one, but this is also the least trusted one. Trusted proxies are stripped. Use this method carefully; you should use getClientIp() instead. Return Value array The client IP addresses See also getClientIp()

Request::getClientIp()

string getClientIp() Returns the client IP address. This method can read the client IP address from the "X-Forwarded-For" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" header value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from. If your reverse proxy uses a different header name than "X-Forwar

Request::getCharsets()

array getCharsets() Gets a list of charsets acceptable by the client browser. Return Value array List of charsets in preferable order

Request::getBaseUrl()

string getBaseUrl() Returns the root URL from which this request is executed. The base URL never ends with a /. This is similar to getBasePath(), except that it also includes the script filename (e.g. index.php) if one exists. Return Value string The raw URL (i.e. not urldecoded)

Request::getBasePath()

string getBasePath() Returns the root path from which this request is executed. Suppose that an index.php file instantiates this request object: http://localhost/index.php returns an empty string http://localhost/index.php/page returns an empty string http://localhost/web/index.php returns '/web' http://localhost/we%20b/index.php returns '/we%20b' Return Value string The raw path (i.e. not urldecoded)

Request::getAcceptableContentTypes()

array getAcceptableContentTypes() Gets a list of content types acceptable by the client browser. Return Value array List of content types in preferable order

Request::enableHttpMethodParameterOverride()

static enableHttpMethodParameterOverride() Enables support for the _method request parameter to determine the intended HTTP method. Be warned that enabling this feature might lead to CSRF issues in your code. Check that you are using CSRF tokens when required. If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered and used to send a "PUT" or "DELETE" request via the _method request parameter. If these methods are not protected

Request::duplicate()

Request duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) Clones a request and overrides some of its parameters. Parameters array $query The GET parameters array $request The POST parameters array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) array $cookies The COOKIE parameters array $files The FILES parameters array $server The SERVER parameters Re

Request::createFromGlobals()

static Request createFromGlobals() Creates a new request with values from PHP's super globals. Return Value Request A new request