\CodeIgniter\HTTPRequestInterface

Expected behavior of an HTTP request

Summary

Methods
Constants
getIPAddress()
isValidIP()
getMethod()
getServer()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getIPAddress()

getIPAddress() : string

Gets the user's IP address.

Returns

string —

IP address

isValidIP()

isValidIP(string  $ip, string  $which = null) : boolean

Validate an IP address

Parameters

string $ip

IP Address

string $which

IP protocol: 'ipv4' or 'ipv6'

Returns

boolean

getMethod()

getMethod(boolean  $upper = false) : string

Get the request method.

Parameters

boolean $upper

Whether to return in upper or lower case.

Returns

string

getServer()

getServer(string  $index = null, null  $filter = null) : mixed

Fetch an item from the $_SERVER array.

Parameters

string $index

Index for item to be fetched from $_SERVER

null $filter

A filter name to be applied

Returns

mixed