Request::getContentType()

string|null getContentType() Gets the format associated with the request. Return Value string|null The format (null if no content type is present)

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::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::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::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::getCharsets()

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

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::create()

static Request create(string $uri, string $method = 'GET', array $parameters = array(), array $cookies = array(), array $files = array(), array $server = array(), string $content = null) Creates a Request based on a given URI and configuration. The information contained in the URI always take precedence over the other information (server and parameters). Parameters string $uri The URI string $method The HTTP method array $parameters The query (GET) or request (POST)

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