GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • CodeIgniter v4.7 API

This view

  • Original page
  • New address

GeezerVison is showing codeigniter4.github.io — CodeIgniter v4.7 API

Menu

Namespaces

CodeIgniter

  • API
  • Autoloader
  • Cache
  • CLI
  • Commands
  • Config
  • Cookie
  • Database
  • DataCaster
  • DataConverter
  • Debug
  • Email
  • Encryption
  • Entity
  • Events
  • Exceptions
  • Files
  • Filters
  • Format
  • Helpers
  • Honeypot
  • HTTP
  • I18n
  • Images
  • Language
  • Log
  • Modules
  • Pager
  • Publisher
  • RESTful
  • Router
  • Security
  • Session
  • Test
  • Throttle
  • Traits
  • Typography
  • Validation
  • View

Packages

Application

Reports

Deprecated

Errors

Markers

Indices

Files

  • CodeIgniter
  • HTTP

RequestInterface extends OutgoingRequestInterface
in
  • Application

RequestInterface.php : 21

Representation of an incoming, server-side HTTP request.

Corresponds to Psr7\ServerRequestInterface.

Table of Contents

Methods

appendBody()  : $this
Appends data to the body of the current message.
appendHeader()  : $this
Adds an additional header value to any headers that accept multiple values (i.e. are an array or implement ArrayAccess)
getBody()  : string|null
Gets the body of the message.
getHeaderLine()  : string
Retrieves a comma-separated string of the values for a single header.
getIPAddress()  : string
Gets the user's IP address.
getMethod()  : string
Retrieves the HTTP method of the request.
getProtocolVersion()  : string
Retrieves the HTTP protocol version as a string.
getServer()  : mixed
Fetch an item from the $_SERVER array.
getUri()  : URI
Retrieves the URI instance.
hasHeader()  : bool
Checks if a header exists by the given case-insensitive name.
header()  : Header|array<int, Header>|null
Returns a single Header object. If multiple headers with the same name exist, then will return an array of header objects.
headers()  : array<string, Header|array<int, Header>>
Returns an array containing all Headers.
populateHeaders()  : void
Populates the $headers array with any headers the server knows about.
prependHeader()  : $this
Adds an additional header value to any headers that accept multiple values (i.e. are an array or implement ArrayAccess)
removeHeader()  : $this
Removes a header from the list of headers we track.
setBody()  : $this
Sets the body of the current message.
setHeader()  : $this
Sets a header and its value.
setProtocolVersion()  : $this
Sets the HTTP protocol version.
withMethod()  : static
Return an instance with the provided HTTP method.
withUri()  : static
Returns an instance with the provided URI.

Methods

appendBody()

MessageInterface.php : 57

Appends data to the body of the current message.

public appendBody(string $data) : $this
Parameters
$data : string
Return values
$this

appendHeader()

MessageInterface.php : 127

Adds an additional header value to any headers that accept multiple values (i.e. are an array or implement ArrayAccess)

public appendHeader(string $name, string|null $value) : $this
Parameters
$name : string
$value : string|null
Return values
$this

getBody()

MessageInterface.php : 48

Gets the body of the message.

public getBody() : string|null
Tags
TODO

Incompatible return type with PSR-7

Return values
string|null

getHeaderLine()

MessageInterface.php : 103

Retrieves a comma-separated string of the values for a single header.

public getHeaderLine(string $name) : string

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.

Parameters
$name : string
Return values
string

getIPAddress()

RequestInterface.php : 29

Gets the user's IP address.

public getIPAddress() : string

Supplied by RequestTrait.

Return values
string —

IP address

getMethod()

OutgoingRequestInterface.php : 30

Retrieves the HTTP method of the request.

public getMethod() : string
Return values
string —

Returns the request method.

getProtocolVersion()

MessageInterface.php : 30

Retrieves the HTTP protocol version as a string.

public getProtocolVersion() : string

The string MUST contain only the HTTP version number (e.g., "1.1", "1.0").

Return values
string —

HTTP protocol version.

getServer()

RequestInterface.php : 40

Fetch an item from the $_SERVER array.

public getServer([array<int, string>|string|null $index = null ][, int|null $filter = null ]) : mixed

Supplied by RequestTrait.

Parameters
$index : array<int, string>|string|null = null

Index for item to be fetched from $_SERVER

$filter : int|null = null

A filter name to be applied

getUri()

OutgoingRequestInterface.php : 58

Retrieves the URI instance.

public getUri() : URI
Tags
see
http://tools.ietf.org/html/rfc3986#section-4.3
Return values
URI

hasHeader()

MessageInterface.php : 80

Checks if a header exists by the given case-insensitive name.

public hasHeader(string $name) : bool
Parameters
$name : string

Case-insensitive header field name.

Return values
bool —

Returns true if any header names match the given header name using a case-insensitive string comparison. Returns false if no matching header name is found in the message.

header()

MessageInterface.php : 90

Returns a single Header object. If multiple headers with the same name exist, then will return an array of header objects.

public header(string $name) : Header|array<int, Header>|null
Parameters
$name : string
Return values
Header|array<int, Header>|null

headers()

MessageInterface.php : 69

Returns an array containing all Headers.

public headers() : array<string, Header|array<int, Header>>
Return values
array<string, Header|array<int, Header>> —

An array of the Header objects

populateHeaders()

MessageInterface.php : 62

Populates the $headers array with any headers the server knows about.

public populateHeaders() : void

prependHeader()

MessageInterface.php : 135

Adds an additional header value to any headers that accept multiple values (i.e. are an array or implement ArrayAccess)

public prependHeader(string $name, string $value) : $this
Parameters
$name : string
$value : string
Return values
$this

removeHeader()

MessageInterface.php : 119

Removes a header from the list of headers we track.

public removeHeader(string $name) : $this
Parameters
$name : string
Return values
$this

setBody()

MessageInterface.php : 39

Sets the body of the current message.

public setBody(string $data) : $this
Parameters
$data : string
Return values
$this

setHeader()

MessageInterface.php : 112

Sets a header and its value.

public setHeader(string $name, array<string|int, string>|string|null $value) : $this
Parameters
$name : string
$value : array<string|int, string>|string|null
Return values
$this

setProtocolVersion()

MessageInterface.php : 144

Sets the HTTP protocol version.

public setProtocolVersion(string $version) : $this
Parameters
$version : string
Tags
throws
HTTPException

For invalid protocols

Return values
$this

withMethod()

OutgoingRequestInterface.php : 49

Return an instance with the provided HTTP method.

public withMethod(string $method) : static

While HTTP method names are typically all uppercase characters, HTTP method names are case-sensitive and thus implementations SHOULD NOT modify the given string.

This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the changed request method.

Parameters
$method : string

Case-sensitive method.

Tags
throws
InvalidArgumentException

for invalid HTTP methods.

Return values
static

withUri()

OutgoingRequestInterface.php : 92

Returns an instance with the provided URI.

public withUri(URI $uri[, bool $preserveHost = false ]) : static

This method MUST update the Host header of the returned request by default if the URI contains a host component. If the URI does not contain a host component, any pre-existing Host header MUST be carried over to the returned request.

You can opt-in to preserving the original state of the Host header by setting $preserveHost to true. When $preserveHost is set to true, this method interacts with the Host header in the following ways:

  • If the Host header is missing or empty, and the new URI contains a host component, this method MUST update the Host header in the returned request.
  • If the Host header is missing or empty, and the new URI does not contain a host component, this method MUST NOT update the Host header in the returned request.
  • If a Host header is present and non-empty, this method MUST NOT update the Host header in the returned request.

This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return an instance that has the new UriInterface instance.

Parameters
$uri : URI

New request URI to use.

$preserveHost : bool = false

Preserve the original state of the Host header.

Tags
see
http://tools.ietf.org/html/rfc3986#section-4.3
Return values
static
On this page
  • Table Of Contents
    • Methods
  • Methods
    • appendBody()
    • appendHeader()
    • getBody()
    • getHeaderLine()
    • getIPAddress()
    • getMethod()
    • getProtocolVersion()
    • getServer()
    • getUri()
    • hasHeader()
    • header()
    • headers()
    • populateHeaders()
    • prependHeader()
    • removeHeader()
    • setBody()
    • setHeader()
    • setProtocolVersion()
    • withMethod()
    • withUri()
    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.