$uri
$uri : \CodeIgniter\HTTP\URI
A \CodeIgniter\HTTP\URI instance.
Class IncomingRequest
Represents an incoming, getServer-side HTTP request.
Per the HTTP specification, this interface includes properties for each of the following:
Additionally, it encapsulates all data as it has arrived to the application from the CGI and/or PHP environment, including:
$uri : \CodeIgniter\HTTP\URI
A \CodeIgniter\HTTP\URI instance.
$config : \Config\App
Configuration settings.
$files : \CodeIgniter\HTTP\Files\FileCollection
File collection
$negotiator : \CodeIgniter\HTTP\Negotiate
Negotiator
$userAgent : \CodeIgniter\HTTP\UserAgent
The user agent this request is from.
__construct(object $config, \CodeIgniter\HTTP\URI $uri = null, string|null $body = 'php://input', \CodeIgniter\HTTP\UserAgent $userAgent)
Constructor
object | $config | |
\CodeIgniter\HTTP\URI | $uri | |
string|null | $body | |
\CodeIgniter\HTTP\UserAgent | $userAgent |
setMethod(string $method) : \CodeIgniter\HTTP\Request
Sets the request method. Used when spoofing the request.
string | $method |
getServer(string|array|null $index = null, integer|null $filter = null, null $flags = null) : mixed
Fetch an item from the $_SERVER array.
string|array|null | $index | Index for item to be fetched from $_SERVER |
integer|null | $filter | A filter name to be applied |
null | $flags |
fetchGlobal(string $method, string|array|null $index = null, integer|null $filter = null, mixed $flags = null) : mixed
Fetches one or more items from a global, like cookies, get, post, etc.
Can optionally filter the input when you retrieve it by passing in a filter.
If $type is an array, it must conform to the input allowed by the filter_input_array method.
http://php.net/manual/en/filter.filters.sanitize.php
string | $method | Input filter constant |
string|array|null | $index | |
integer|null | $filter | Filter constant |
mixed | $flags |
setBody( $data) : \CodeIgniter\HTTP\Message|\CodeIgniter\HTTP\Response
Sets the body of the current message.
$data |
appendBody( $data) : \CodeIgniter\HTTP\Message|\CodeIgniter\HTTP\Response
Appends data to the body of the current message.
$data |
getHeader(string $name) : array|\CodeIgniter\HTTP\Header
Returns a single header object. If multiple headers with the same name exist, then will return an array of header objects.
string | $name |
getHeaderLine(string $name) : string
Retrieves a comma-separated string of the values for a single header.
This method returns all of the header values of the given case-insensitive header name as a string concatenated together using a comma.
NOTE: Not all header values may be appropriately represented using comma concatenation. For such headers, use getHeader() instead and supply your own delimiter when concatenating.
string | $name |
setHeader(string $name, array|null|string $value) : \CodeIgniter\HTTP\Message|\CodeIgniter\HTTP\Response
Sets a header and it's value.
string | $name | |
array|null|string | $value |
removeHeader(string $name) : \CodeIgniter\HTTP\Message
Removes a header from the list of headers we track.
string | $name |
appendHeader(string $name, string $value) : \CodeIgniter\HTTP\Message
Adds an additional header value to any headers that accept multiple values (i.e. are an array or implement ArrayAccess)
string | $name | |
string | $value |
prependHeader(string $name, string $value) : \CodeIgniter\HTTP\Message
Adds an additional header value to any headers that accept multiple values (i.e. are an array or implement ArrayAccess)
string | $name | |
string | $value |
setProtocolVersion(string $version) : \CodeIgniter\HTTP\Message
Sets the HTTP protocol version.
string | $version |
setLocale(string $locale) : \CodeIgniter\HTTP\IncomingRequest
Sets the locale string for this request.
string | $locale |
getVar(string|array|null $index = null, integer|null $filter = null, mixed $flags = null) : mixed
Fetch an item from the $_REQUEST object. This is the simplest way to grab data from the request object and can be used in lieu of the other get* methods in most cases.
string|array|null | $index | |
integer|null | $filter | Filter constant |
mixed | $flags |
getJSON(boolean $assoc = false, integer $depth = 512, integer $options) : mixed
A convenience method that grabs the raw input stream and decodes the JSON into an array.
If $assoc == true, then all objects in the response will be converted to associative arrays.
boolean | $assoc | Whether to return objects as associative arrays |
integer | $depth | How many levels deep to decode |
integer | $options | Bitmask of options |
getPostGet(string|array|null $index = null, integer|null $filter = null, mixed $flags = null) : mixed
Fetch an item from POST data with fallback to GET.
string|array|null | $index | Index for item to fetch from $_POST or $_GET |
integer|null | $filter | A filter name to apply |
mixed | $flags |
getGetPost(string|array|null $index = null, integer|null $filter = null, mixed $flags = null) : mixed
Fetch an item from GET data with fallback to POST.
string|array|null | $index | Index for item to be fetched from $_GET or $_POST |
integer|null | $filter | A filter name to apply |
mixed | $flags |
getCookie(string|array|null $index = null, integer|null $filter = null, mixed $flags = null) : mixed
Fetch an item from the COOKIE array.
string|array|null | $index | Index for item to be fetched from $_COOKIE |
integer|null | $filter | A filter name to be applied |
mixed | $flags |
getUserAgent() : \CodeIgniter\HTTP\UserAgent
Fetch the user agent string
getFile(string $fileID) : \CodeIgniter\HTTP\Files\UploadedFile|null
Retrieves a single file by the name of the input field used to upload it.
string | $fileID |