TelegramPHP Documentation

Request
in package

FinalYes

One prepared Bot API call: the method name, the absolute URL, the encoded body, the headers, and the {@see Deferred} that {@see Http} settles with the unwrapped `result`.

The Bot API is a flat RPC surface - every method call is a POST to /bot<token>/<method> - so a request carries no path of its own beyond the method name. File downloads (GET /file/bot<token>/<file_path>) reuse the same object with an explicit verb.

Tags
author

Valithor Obsidion valithor@valgorithms.com

Table of Contents

Properties

$attempts  : int
$content  : string
$deferred  : Deferred
$endpoint  : string
$headers  : array<string|int, mixed>
$method  : string
$url  : string

Methods

__construct()  : mixed
__toString()  : string
bumpAttempts()  : int
getAttempts()  : int
getContent()  : string
getDeferred()  : Deferred
getEndpoint()  : string
The Bot API method name, e.g. `sendMessage`.
getHeaders()  : array<string, string>
getMethod()  : string
`POST` for every method call; `GET` for a file download.
getUrl()  : string
The absolute URL, token included.
setHeader()  : void

Properties

$content read-only

private string $content = ''

$deferred read-only

private Deferred $deferred

$endpoint read-only

private string $endpoint

$headers

private array<string|int, mixed> $headers = []

$method read-only

private string $method = 'POST'

Methods

__construct()

public __construct(Deferred $deferred, string $endpoint, string $url[, string $content = '' ][, array<string, string> $headers = [] ][, string $method = 'POST' ]) : mixed
Parameters
$deferred : Deferred
$endpoint : string

The Bot API method name, or the file path for a download.

$url : string
$content : string = ''
$headers : array<string, string> = []
$method : string = 'POST'

__toString()

public __toString() : string
Return values
string

bumpAttempts()

public bumpAttempts() : int
Return values
int

getAttempts()

public getAttempts() : int
Return values
int

getContent()

public getContent() : string
Return values
string

getDeferred()

public getDeferred() : Deferred
Return values
Deferred

getEndpoint()

The Bot API method name, e.g. `sendMessage`.

public getEndpoint() : string
Return values
string

getHeaders()

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

getMethod()

`POST` for every method call; `GET` for a file download.

public getMethod() : string
Return values
string

getUrl()

The absolute URL, token included.

public getUrl() : string
Return values
string

setHeader()

public setHeader(string $name, string $value) : void
Parameters
$name : string
$value : string
On this page

Search results