PHP Класс Scalr\Api\Rest\Http\Request

С версии: 5.4.0 (09.02.2015)
Автор: Vitaliy Demidov ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$formDataMediaTypes
$jsonDataMediaTypes

Открытые методы

Метод Описание
__construct ( Scalr\Api\Rest\Environment $appEnv ) Constructor
delete ( string $key = null, string $default = null ) : mixed Gets DELETE data
get ( string $key = null, string $default = null ) : mixed Gets GET data
getBody ( ) : string Gets request raw body
getContentLength ( ) : integer Gets Content length
getContentType ( ) : string | null Gets Content Type
getHost ( ) : string Gets server host
getIp ( ) : string | null Gets IP address
getJsonBody ( ) : mixed Gets request's json decoded body
getMediaType ( ) : string | null Gets media type
getMediaTypeParams ( ) : array Gets media type parameters
getMethod ( ) : string Gets HTTP Request method
getOrigin ( ) : string | null Gets HTTP origin
getPath ( ) : string Gets path
getPathInfo ( ) : string Gets path info
getPort ( ) : number Gets server port
getReferer ( ) : string | null Gets HTTP Referer
getScheme ( ) : string Gets scheme
getScriptName ( ) : string Gets script name
getUrl ( ) : string Gets URL
getUserAgent ( ) : string | null Gets User Agent
hasMethod ( string $method ) : boolean Checks whether specified method is accepted for the request
headers ( string $key = null, string $default = null ) : string Gets header
isFormData ( ) : boolean Whether content type is application/x-www-form-urlencoded
isJsonData ( ) : boolean Whether content type is application/json
patch ( string $key = null, string $default = null ) : mixed Gets PATCH data
post ( string $key = null, string $default = null ) : mixed Gets POST data
put ( string $key = null, string $default = null ) : mixed Gets PUT data

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Scalr\Api\Rest\Environment $appEnv )
$appEnv Scalr\Api\Rest\Environment Application environment variables

delete() публичный Метод

Gets DELETE data
public delete ( string $key = null, string $default = null ) : mixed
$key string optional Variable name
$default string optional Default value for the variable
Результат mixed Returns variable value

get() публичный Метод

Gets GET data
public get ( string $key = null, string $default = null ) : mixed
$key string optional Variable name
$default string optional Default value for the variable
Результат mixed Returns variable value

getBody() публичный Метод

Gets request raw body
public getBody ( ) : string
Результат string Returns request raw body

getContentLength() публичный Метод

Gets Content length
public getContentLength ( ) : integer
Результат integer Returns content length

getContentType() публичный Метод

Gets Content Type
public getContentType ( ) : string | null
Результат string | null

getHost() публичный Метод

Gets server host
public getHost ( ) : string
Результат string Returns server host

getIp() публичный Метод

Gets IP address
public getIp ( ) : string | null
Результат string | null Returns IP address

getJsonBody() публичный Метод

Gets request's json decoded body
public getJsonBody ( ) : mixed
Результат mixed Returns json decoded body

getMediaType() публичный Метод

Gets media type
public getMediaType ( ) : string | null
Результат string | null Returns media type

getMediaTypeParams() публичный Метод

Gets media type parameters
public getMediaTypeParams ( ) : array
Результат array Returns media type parameters

getMethod() публичный Метод

Gets HTTP Request method
public getMethod ( ) : string
Результат string Returns HTTP Request method

getOrigin() публичный Метод

Gets HTTP origin
public getOrigin ( ) : string | null
Результат string | null

getPath() публичный Метод

Gets path
public getPath ( ) : string
Результат string Returns path

getPathInfo() публичный Метод

Gets path info
public getPathInfo ( ) : string
Результат string Returns path info

getPort() публичный Метод

Gets server port
public getPort ( ) : number
Результат number Returns server port

getReferer() публичный Метод

Gets HTTP Referer
public getReferer ( ) : string | null
Результат string | null Gets HTTP Referer

getScheme() публичный Метод

Gets scheme
public getScheme ( ) : string
Результат string Returns scheme (http or https)

getScriptName() публичный Метод

Gets script name
public getScriptName ( ) : string
Результат string Returns script name

getUrl() публичный Метод

Gets URL
public getUrl ( ) : string
Результат string Returns URL

getUserAgent() публичный Метод

Gets User Agent
public getUserAgent ( ) : string | null
Результат string | null Returns User Agent

hasMethod() публичный статический Метод

Checks whether specified method is accepted for the request
public static hasMethod ( string $method ) : boolean
$method string HTTP Method
Результат boolean Returns TRUE if the specified method is accepted for the request

headers() публичный Метод

Gets header
public headers ( string $key = null, string $default = null ) : string
$key string optional The header name
$default string optional Default value
Результат string Returns header value

isFormData() публичный Метод

Whether content type is application/x-www-form-urlencoded
public isFormData ( ) : boolean
Результат boolean Returns true if content type is a form data

isJsonData() публичный Метод

Whether content type is application/json
public isJsonData ( ) : boolean
Результат boolean Returns TRUE if content type is json

patch() публичный Метод

Gets PATCH data
public patch ( string $key = null, string $default = null ) : mixed
$key string optional Variable name
$default string optional Default value for the variable
Результат mixed Returns variable value

post() публичный Метод

Gets POST data
public post ( string $key = null, string $default = null ) : mixed
$key string optional Variable name
$default string optional Default value for the variable
Результат mixed Returns variable value

put() публичный Метод

Gets PUT data
public put ( string $key = null, string $default = null ) : mixed
$key string optional Variable name
$default string optional Default value for the variable
Результат mixed Returns variable value

Описание свойств

$formDataMediaTypes защищенное статическое свойство

protected static $formDataMediaTypes

$jsonDataMediaTypes защищенное статическое свойство

protected static $jsonDataMediaTypes