Documentation

CurlWrapper
in package

Wrapper for CURL routines

Table of Contents

isHeaderExists()  : bool
Does the specified header exists
packArray()  : array<string|int, mixed>
Method packs arrays
packData()  : string
Method packs data in string
sendRequest()  : array<string|int, mixed>
Method send HTTP request

Methods

isHeaderExists()

Does the specified header exists

public static isHeaderExists(array<string|int, mixed> $headers, string $requiredHeader) : bool
Parameters
$headers : array<string|int, mixed>

list of headers to be analized

$requiredHeader : string

header to be found

Return values
bool

true if the header was found, false otherwise

packArray()

Method packs arrays

public static packArray(string $fieldName, array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$fieldName : string

field name

$data : array<string|int, mixed>

array data to be packed

Return values
array<string|int, mixed>

packed array data

packData()

Method packs data in string

public static packData(array<string|int, mixed> $data) : string
Parameters
$data : array<string|int, mixed>

data to be packed

Return values
string

packed data

sendRequest()

Method send HTTP request

public static sendRequest(string $url, array<string|int, mixed> $headers, string $method[, array<string|int, mixed> $data = [] ]) : array<string|int, mixed>
Parameters
$url : string

URL

$headers : array<string|int, mixed>

Headers

$method : string

Request HTTP Method

$data : array<string|int, mixed> = []

Request data

Return values
array<string|int, mixed>

Response body and HTTP code

Search results

    Яндекс.Метрика