PDFGate's PHP SDK

HttpRequest
in package

Immutable HTTP request used by transport implementations.

Table of Contents

Properties

$headers  : array<string, string>
$jsonBody  : array<string, mixed>|null
$method  : string
$multipartBody  : array<string, mixed>|null
$timeout  : int
$url  : string

Methods

__set()  : void
__unset()  : void
getHeaders()  : array<string, string>
getJsonBody()  : array<string, mixed>|null
getMethod()  : string
getMultipartBody()  : array<string, mixed>|null
getTimeout()  : int
getUrl()  : string
makeGet()  : self
makePostJson()  : self
makePostMultipart()  : self
__construct()  : mixed

Properties

$jsonBody

private array<string, mixed>|null $jsonBody

$multipartBody

private array<string, mixed>|null $multipartBody

Methods

__set()

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

__unset()

public __unset(string $name) : void
Parameters
$name : string

getHeaders()

public getHeaders() : array<string, string>
Return values
array<string, string>

getJsonBody()

public getJsonBody() : array<string, mixed>|null
Return values
array<string, mixed>|null

getMethod()

public getMethod() : string
Return values
string

getMultipartBody()

public getMultipartBody() : array<string, mixed>|null
Return values
array<string, mixed>|null

getTimeout()

public getTimeout() : int
Return values
int

getUrl()

public getUrl() : string
Return values
string

makeGet()

public static makeGet(string $url[, array<string, string> $headers = array() ][, int $timeout = 60 ]) : self
Parameters
$url : string

Full request URL including optional query string.

$headers : array<string, string> = array()

HTTP headers map.

$timeout : int = 60

Total request timeout in seconds.

Return values
self

makePostJson()

public static makePostJson(string $url[, array<string, string> $headers = array() ][, array<string, mixed>|null $jsonBody = null ][, int $timeout = 60 ]) : self
Parameters
$url : string

Full request URL without query string.

$headers : array<string, string> = array()

HTTP headers map.

$jsonBody : array<string, mixed>|null = null

JSON request body.

$timeout : int = 60

Total request timeout in seconds.

Return values
self

makePostMultipart()

public static makePostMultipart(string $url[, array<string, string> $headers = array() ][, array<string, mixed>|null $multipartBody = null ][, int $timeout = 60 ]) : self
Parameters
$url : string

Full request URL without query string.

$headers : array<string, string> = array()

HTTP headers map.

$multipartBody : array<string, mixed>|null = null

multipart/form-data request body.

$timeout : int = 60

Total request timeout in seconds.

Return values
self

__construct()

private __construct(string $method, string $url[, array<string, string> $headers = array() ][, array<string, mixed>|null $jsonBody = null ][, array<string, mixed>|null $multipartBody = null ][, int $timeout = 60 ]) : mixed
Parameters
$method : string

HTTP method.

$url : string

Full request URL without query string.

$headers : array<string, string> = array()

HTTP headers map.

$jsonBody : array<string, mixed>|null = null

JSON request body.

$multipartBody : array<string, mixed>|null = null

multipart/form-data request body.

$timeout : int = 60

Total request timeout in seconds.


        
On this page

Search results