Documentation

Matrix_client extends HTTP_client
in package

A HTTP client based on CURL.

Table of Contents

Properties

$curl  : mixed
A CURL instance.
$server  : mixed
Server URL.

Methods

__construct()  : mixed
The main class constructor.
__destruct()  : mixed
The main class destructor that closes the current CURL session.
get()  : HTTP|mixed
Make an HTTP GET request.
get_domain()  : Domain
Get domain name from the server URL.
get_port()  : Port
Get server port from the URL.
get_server()  : HTTP
Get the current server.
handle_result()  : mixed
post()  : HTTP|mixed
Make an HTTP POST request.
post_file()  : bool|mixed|string
Post a file to a server.
put()  : HTTP|mixed
Make an HTTP PUT request.
set_debug_mode()  : void
Set Curl debug mode to $value.
get_curl()  : mixed
Get Curl handle.
set_opt()  : void
Set Curl option.

Properties

Methods

__construct()

The main class constructor.

public __construct( $server_location) : mixed
Parameters
$server_location :

__destruct()

The main class destructor that closes the current CURL session.

public __destruct() : mixed

get()

Make an HTTP GET request.

public get(string $resource[, array<string|int, mixed> $params = [] ]) : HTTP|mixed
Parameters
$resource : string
$params : array<string|int, mixed> = []
Tags
throws
Matrix_exception
Return values
HTTP|mixed

get_domain()

Get domain name from the server URL.

public get_domain() : Domain
Return values
Domain

name as a string.

get_port()

Get server port from the URL.

public get_port() : Port
Return values
Port

number;

get_server()

Get the current server.

public get_server() : HTTP
Return values
HTTP

server link as a string.

post()

Make an HTTP POST request.

public post(string $resource,  $data[, array<string|int, mixed> $params = [] ][,  $_ = null ]) : HTTP|mixed
Parameters
$resource : string
$data :
$params : array<string|int, mixed> = []
$_ : = null
Tags
throws
Matrix_exception
Return values
HTTP|mixed

post_file()

Post a file to a server.

public post_file(string $resource, string $file_path[, array<string|int, mixed> $params = [] ][, array<string|int, mixed> $headers = [] ]) : bool|mixed|string
Parameters
$resource : string
$file_path : string
$params : array<string|int, mixed> = []
$headers : array<string|int, mixed> = []
Tags
throws
Matrix_exception
Return values
bool|mixed|string

put()

Make an HTTP PUT request.

public put(string $resource,  $data[, array<string|int, mixed> $params = [] ][,  $_ = null ]) : HTTP|mixed
Parameters
$resource : string
$data :
$params : array<string|int, mixed> = []
$_ : = null
Tags
throws
Matrix_exception
Return values
HTTP|mixed

set_debug_mode()

Set Curl debug mode to $value.

public set_debug_mode(bool $is_enabled) : void
Parameters
$is_enabled : bool

Is debug mode enabled?

get_curl()

Get Curl handle.

protected get_curl() : mixed
Return values
mixed

Curl handle.

set_opt()

Set Curl option.

protected set_opt(int $option,  $value) : void
Parameters
$option : int

Option to set.

$value :

Value to set.


        
On this page

Search results