HttpClient class

package Default

 Methods

DELETE Communication

delete(string $url, \Kore\array<mixed> $params = array(), \Kore\array<mixed> $headers = array(), string|null $userpwd = null) : \Kore\HttpResponse
see \Kore\HttpResponse

Parameters

$url

string

request url

$params

\Kore\array<mixed>

request parameters

$headers

\Kore\array<mixed>

request headers

$userpwd

stringnull

user name and password

Exceptions

\Exception

Returns

\Kore\HttpResponse\Kore\HttpResponse

GET Communication

get(string $url, \Kore\array<mixed> $params = array(), \Kore\array<mixed> $headers = array(), string|null $userpwd = null) : \Kore\HttpResponse
see \Kore\HttpResponse

Parameters

$url

string

request url

$params

\Kore\array<mixed>

request parameters

$headers

\Kore\array<mixed>

request headers

$userpwd

stringnull

user name and password

Exceptions

\Exception

Returns

\Kore\HttpResponse\Kore\HttpResponse

PATCH Communication

patch(string $url, \Kore\array<mixed> $params = array(), \Kore\array<mixed> $headers = array(), string|null $userpwd = null) : \Kore\HttpResponse
see \Kore\HttpResponse

Parameters

$url

string

request url

$params

\Kore\array<mixed>

request parameters

$headers

\Kore\array<mixed>

request headers

$userpwd

stringnull

user name and password

Exceptions

\Exception

Returns

\Kore\HttpResponse\Kore\HttpResponse

POST Communication

post(string $url, \Kore\array<mixed> $params = array(), \Kore\array<mixed> $headers = array(), string|null $userpwd = null) : \Kore\HttpResponse
see \Kore\HttpResponse

Parameters

$url

string

request url

$params

\Kore\array<mixed>

request parameters

$headers

\Kore\array<mixed>

request headers

$userpwd

stringnull

user name and password

Exceptions

\Exception

Returns

\Kore\HttpResponse\Kore\HttpResponse

PUT Communication

put(string $url, \Kore\array<mixed> $params = array(), \Kore\array<mixed> $headers = array(), string|null $userpwd = null) : \Kore\HttpResponse
see \Kore\HttpResponse

Parameters

$url

string

request url

$params

\Kore\array<mixed>

request parameters

$headers

\Kore\array<mixed>

request headers

$userpwd

stringnull

user name and password

Exceptions

\Exception

Returns

\Kore\HttpResponse\Kore\HttpResponse

Set connect timeout

setConnectTimeout(integer $connectTimeout) : void

Parameters

$connectTimeout

integer

connect timeout

Set timeout

setTimeout(integer $timeout) : void

Parameters

$timeout

integer

timeout

Build headers

buildHeader(\Kore\array<mixed> $headers) : \Kore\array<string>

Build the associative array headers into a curl-friendly format.

Parameters

$headers

\Kore\array<mixed>

headers

Returns

\Kore\array<string>built headers

Communication Processing

communicate(string $method, string $url, \Kore\array<mixed> $params = array(), \Kore\array<mixed> $headers = array(), string|null $userpwd = null) : \Kore\HttpResponse
see \Kore\HttpResponse

Parameters

$method

string

http method

$url

string

request url

$params

\Kore\array<mixed>

request parameters

$headers

\Kore\array<mixed>

request headers

$userpwd

stringnull

user name and password

Exceptions

\Exception

Returns

\Kore\HttpResponse\Kore\HttpResponse

 Properties

 

connect timeout

$connectTimeout : integer

Default

300

Used as the value of CURLOPT_CONNECTTIMEOUT. If unspecified, the default is 300. For unlimited, specify 0.

 

timeout

$timeout : integer

Default

300

Used as the value of CURLOPT_TIMEOUT. If unspecified, the default is 300. For unlimited, specify 0.