Request
in package
implements
JsonSerializable
Uses
TArrayTools
Interfaces, Classes, Traits and Enums
- JsonSerializable
Table of Contents
- QS_VAR_ARRAY = 2
- QS_VAR_DUPLICATE = 1
- TYPE_DELETE = 3
- TYPE_GET = 0
- TYPE_POST = 1
- TYPE_PUT = 2
- $TYPE_ARRAY : mixed
- $TYPE_BOOLEAN : mixed
- $TYPE_INTEGER : mixed
- $TYPE_NULL : mixed
- $TYPE_SERIALIZABLE : mixed
- $TYPE_STRING : mixed
- $baseUrl : string
- $binary : bool
- $contentType : string
- $cookies : array<string|int, mixed>
- $data : array<string|int, mixed>
- $followLocation : bool
- $headers : array<string|int, mixed>
- $host : string
- $httpErrorsAllowed : bool
- $params : array<string|int, mixed>
- $port : int
- $protocol : string
- $protocols : array<string|int, mixed>
- $queryStringType : int
- $resultCode : int
- $timeout : int
- $type : int
- $url : string
- $userAgent : string
- $verifyPeer : bool
- __construct() : mixed
- Request constructor.
- addData() : Request
- addDataInt() : Request
- addHeader() : Request
- addParam() : Request
- addParamInt() : Request
- basedOnUrl() : mixed
- getAddress() : string
- getCompleteUrl() : string
- getContentType() : string
- getCookies() : array<string|int, mixed>
- getData() : array<string|int, mixed>
- getDataBody() : string
- getHeaders() : array<string|int, mixed>
- getHost() : string
- getInstance() : string
- getParametersUrl() : string
- getParams() : array<string|int, mixed>
- getParsedUrl() : string
- getPath() : string
- getPort() : int
- getProtocols() : array<string|int, string>
- getQueryString() : string
- getQueryStringType() : int
- getResultCode() : int
- getTimeout() : int
- getType() : int
- getUrl() : string
- getUrlData() : string
- getUrlParams() : string
- getUsedProtocol() : string
- getUserAgent() : string
- isBinary() : bool
- isFollowLocation() : bool
- isHttpErrorsAllowed() : bool
- isVerifyPeer() : bool
- jsonSerialize() : array<string|int, mixed>
- method() : string
- setAddress() : Request
- setAddressFromUrl() : mixed
- setBaseUrl() : Request
- setContentType() : Request
- setCookies() : Request
- setData() : Request
- setDataJson() : Request
- setDataSerialize() : Request
- setFollowLocation() : $this
- setHeaders() : Request
- setHost() : Request
- setHttpErrorsAllowed() : Request
- setInstance() : Request
- setParams() : Request
- setPort() : Request
- setProtocol() : Request
- setProtocols() : Request
- setQueryStringType() : Request
- setResultCode() : Request
- setTimeout() : Request
- setUsedProtocol() : Request
- setUserAgent() : Request
- setVerifyPeer() : $this
- type() : int
- typeOf() : string
- validKey() : bool
- cleanArray() : mixed
- extractArray() : mixed
- get() : string
- getArray() : array<string|int, mixed>
- getBool() : bool
- getFloat() : float
- getInt() : int
- getList() : array<string|int, mixed>
- getObj() : mixed
- mustContains() : mixed
Constants
QS_VAR_ARRAY
public
mixed
QS_VAR_ARRAY
= 2
QS_VAR_DUPLICATE
public
mixed
QS_VAR_DUPLICATE
= 1
TYPE_DELETE
public
mixed
TYPE_DELETE
= 3
TYPE_GET
public
mixed
TYPE_GET
= 0
TYPE_POST
public
mixed
TYPE_POST
= 1
TYPE_PUT
public
mixed
TYPE_PUT
= 2
Properties
$TYPE_ARRAY
public
static mixed
$TYPE_ARRAY
= 'Array'
$TYPE_BOOLEAN
public
static mixed
$TYPE_BOOLEAN
= 'Boolean'
$TYPE_INTEGER
public
static mixed
$TYPE_INTEGER
= 'Integer'
$TYPE_NULL
public
static mixed
$TYPE_NULL
= 'Null'
$TYPE_SERIALIZABLE
public
static mixed
$TYPE_SERIALIZABLE
= 'Serializable'
$TYPE_STRING
public
static mixed
$TYPE_STRING
= 'String'
$baseUrl
private
string
$baseUrl
= ''
$binary
private
bool
$binary
= false
$contentType
private
string
$contentType
= ''
$cookies
private
array<string|int, mixed>
$cookies
= []
$data
private
array<string|int, mixed>
$data
= []
$followLocation
private
bool
$followLocation
= true
$headers
private
array<string|int, mixed>
$headers
= []
$host
private
string
$host
= ''
$httpErrorsAllowed
private
bool
$httpErrorsAllowed
= false
$params
private
array<string|int, mixed>
$params
= []
$port
private
int
$port
= 0
$protocol
private
string
$protocol
= ''
$protocols
private
array<string|int, mixed>
$protocols
= ['https']
$queryStringType
private
int
$queryStringType
= self::QS_VAR_DUPLICATE
$resultCode
private
int
$resultCode
= 0
$timeout
private
int
$timeout
= 10
$type
private
int
$type
= 0
$url
private
string
$url
= ''
$userAgent
private
string
$userAgent
= ''
$verifyPeer
private
bool
$verifyPeer
= true
Methods
__construct()
Request constructor.
public
__construct([string $url = '' ], int $type[, bool $binary = false ]) : mixed
Parameters
- $url : string = ''
- $type : int
- $binary : bool = false
Return values
mixed —addData()
public
addData(string $k, string $v) : Request
Parameters
- $k : string
- $v : string
Return values
Request —addDataInt()
public
addDataInt(string $k, int $v) : Request
Parameters
- $k : string
- $v : int
Return values
Request —addHeader()
public
addHeader(mixed $key, mixed $value) : Request
Parameters
- $key : mixed
- $value : mixed
Return values
Request —addParam()
public
addParam(string $k, string $v) : Request
Parameters
- $k : string
- $v : string
Return values
Request —addParamInt()
public
addParamInt(string $k, int $v) : Request
Parameters
- $k : string
- $v : int
Return values
Request —basedOnUrl()
public
basedOnUrl(string $url) : mixed
Parameters
- $url : string
Return values
mixed —getAddress()
public
getAddress() : string
Tags
Return values
string —getCompleteUrl()
public
getCompleteUrl() : string
Return values
string —getContentType()
public
getContentType() : string
Return values
string —getCookies()
public
getCookies() : array<string|int, mixed>
Return values
array<string|int, mixed> —getData()
public
getData() : array<string|int, mixed>
Return values
array<string|int, mixed> —getDataBody()
public
getDataBody() : string
Return values
string —getHeaders()
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed> —getHost()
public
getHost() : string
Return values
string —getInstance()
public
getInstance() : string
Return values
string —getParametersUrl()
public
getParametersUrl() : string
Return values
string —getParams()
public
getParams() : array<string|int, mixed>
Return values
array<string|int, mixed> —getParsedUrl()
public
getParsedUrl() : string
Tags
Return values
string —getPath()
public
getPath() : string
Return values
string —getPort()
public
getPort() : int
Return values
int —getProtocols()
public
getProtocols() : array<string|int, string>
Return values
array<string|int, string> —getQueryString()
public
getQueryString() : string
Return values
string —getQueryStringType()
public
getQueryStringType() : int
Return values
int —getResultCode()
public
getResultCode() : int
Return values
int —getTimeout()
public
getTimeout() : int
Return values
int —getType()
public
getType() : int
Return values
int —getUrl()
public
getUrl() : string
Tags
Return values
string —getUrlData()
public
getUrlData() : string
Tags
Return values
string —getUrlParams()
public
getUrlParams() : string
Tags
Return values
string —getUsedProtocol()
public
getUsedProtocol() : string
Return values
string —getUserAgent()
public
getUserAgent() : string
Return values
string —isBinary()
public
isBinary() : bool
Return values
bool —isFollowLocation()
public
isFollowLocation() : bool
Return values
bool —isHttpErrorsAllowed()
public
isHttpErrorsAllowed() : bool
Return values
bool —isVerifyPeer()
public
isVerifyPeer() : bool
Return values
bool —jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed> —method()
public
static method(int $type) : string
Parameters
- $type : int
Return values
string —setAddress()
public
setAddress(string $address) : Request
Parameters
- $address : string
Tags
Return values
Request —setAddressFromUrl()
public
setAddressFromUrl(string $url) : mixed
Parameters
- $url : string
Tags
Return values
mixed —setBaseUrl()
public
setBaseUrl(string|null $baseUrl) : Request
Parameters
- $baseUrl : string|null
Return values
Request —setContentType()
public
setContentType(string $contentType) : Request
Parameters
- $contentType : string
Return values
Request —setCookies()
public
setCookies(array<string|int, mixed> $cookies) : Request
Parameters
- $cookies : array<string|int, mixed>
Return values
Request —setData()
public
setData(array<string|int, mixed> $data) : Request
Parameters
- $data : array<string|int, mixed>
Return values
Request —setDataJson()
public
setDataJson(string $data) : Request
Parameters
- $data : string
Return values
Request —setDataSerialize()
public
setDataSerialize(JsonSerializable $data) : Request
Parameters
- $data : JsonSerializable
Return values
Request —setFollowLocation()
public
setFollowLocation(bool $followLocation) : $this
Parameters
- $followLocation : bool
Return values
$this —setHeaders()
public
setHeaders(array<string|int, mixed> $headers) : Request
Parameters
- $headers : array<string|int, mixed>
Return values
Request —setHost()
public
setHost(string $host) : Request
Parameters
- $host : string
Return values
Request —setHttpErrorsAllowed()
public
setHttpErrorsAllowed(bool $httpErrorsAllowed) : Request
Parameters
- $httpErrorsAllowed : bool
Return values
Request —setInstance()
public
setInstance(string $instance) : Request
Parameters
- $instance : string
Return values
Request —setParams()
public
setParams(array<string|int, mixed> $params) : Request
Parameters
- $params : array<string|int, mixed>
Return values
Request —setPort()
public
setPort(int $port) : Request
Parameters
- $port : int
Return values
Request —setProtocol()
public
setProtocol(string $protocol) : Request
Parameters
- $protocol : string
Return values
Request —setProtocols()
public
setProtocols(array<string|int, mixed> $protocols) : Request
Parameters
- $protocols : array<string|int, mixed>
Return values
Request —setQueryStringType()
public
setQueryStringType(int $queryStringType) : Request
Parameters
- $queryStringType : int
Return values
Request —setResultCode()
public
setResultCode(int $resultCode) : Request
Parameters
- $resultCode : int
Return values
Request —setTimeout()
public
setTimeout(int $timeout) : Request
Parameters
- $timeout : int
Return values
Request —setUsedProtocol()
public
setUsedProtocol(string $protocol) : Request
Parameters
- $protocol : string
Return values
Request —setUserAgent()
public
setUserAgent(string $userAgent) : Request
Parameters
- $userAgent : string
Return values
Request —setVerifyPeer()
public
setVerifyPeer(bool $verifyPeer) : $this
Parameters
- $verifyPeer : bool
Return values
$this —type()
public
static type(string $type) : int
Parameters
- $type : string
Return values
int —typeOf()
public
typeOf(string $key, array<string|int, mixed> $arr[, bool $root = true ]) : string
Parameters
- $key : string
- $arr : array<string|int, mixed>
- $root : bool = true
Tags
Return values
string —validKey()
public
validKey(string $k, array<string|int, mixed> $arr) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
Return values
bool —cleanArray()
protected
cleanArray(array<string|int, mixed> &$arr) : mixed
Parameters
- $arr : array<string|int, mixed>
Return values
mixed —extractArray()
protected
extractArray(string $k, string $value, array<string|int, mixed> $list) : mixed
Parameters
- $k : string
- $value : string
- $list : array<string|int, mixed>
Tags
Return values
mixed —get()
protected
get(string $k, array<string|int, mixed> $arr[, string $default = '' ]) : string
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : string = ''
Return values
string —getArray()
protected
getArray(string $k, array<string|int, mixed> $arr[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getBool()
protected
getBool(string $k, array<string|int, mixed> $arr[, bool $default = false ]) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : bool = false
Return values
bool —getFloat()
protected
getFloat(string $k, array<string|int, mixed> $arr, float $default) : float
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : float
Return values
float —getInt()
protected
getInt(string $k, array<string|int, mixed> $arr, int $default) : int
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : int
Return values
int —getList()
protected
getList(string $k, array<string|int, mixed> $arr, array<string|int, mixed> $import[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $import : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getObj()
protected
getObj(string $k, array<string|int, mixed> $arr[, JsonSerializable|null $default = null ]) : mixed
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : JsonSerializable|null = null
Return values
mixed —mustContains()
protected
mustContains(array<string|int, mixed> $keys, array<string|int, mixed> $arr) : mixed
Parameters
- $keys : array<string|int, mixed>
- $arr : array<string|int, mixed>