TelegramRequest
class TelegramRequest (View source)
Class TelegramRequest.
Builds Telegram Bot API Request Entity.
Methods
Creates a new Request entity.
Set the bot access token for this request.
Return the bot access token for this request.
Validate that bot access token exists for this request.
Set the HTTP method for this request.
Return the HTTP method for this request.
Validate that the HTTP method is set.
Set the endpoint for this request.
Return the API Endpoint for this request.
Set the params for this request.
Return the params for this request.
Set the headers for this request.
Return the headers for this request.
Make this request asynchronous (non-blocking).
Check if this is an asynchronous request (non-blocking).
Only return params on POST requests.
The default headers used with every request.
No description
No description
No description
No description
Details
at line 76
__construct(
string|null $accessToken = null,
string|null $method = null,
string|null $endpoint = null,
array $params = array(),
bool $isAsyncRequest = false,
int $timeOut = 60,
int $connectTimeOut = 10)
Creates a new Request entity.
at line 101
TelegramRequest
setAccessToken(
string $accessToken)
Set the bot access token for this request.
at line 113
string|null
getAccessToken()
Return the bot access token for this request.
at line 123
validateAccessToken()
Validate that bot access token exists for this request.
at line 138
TelegramRequest
setMethod(
string $method)
Set the HTTP method for this request.
at line 150
string
getMethod()
Return the HTTP method for this request.
at line 160
validateMethod()
Validate that the HTTP method is set.
at line 178
TelegramRequest
setEndpoint(
string $endpoint)
Set the endpoint for this request.
at line 190
string
getEndpoint()
Return the API Endpoint for this request.
at line 202
TelegramRequest
setParams(
array $params = array())
Set the params for this request.
at line 214
array
getParams()
Return the params for this request.
at line 226
TelegramRequest
setHeaders(
array $headers)
Set the headers for this request.
at line 238
array
getHeaders()
Return the headers for this request.
at line 252
TelegramRequest
setAsyncRequest($isAsyncRequest)
Make this request asynchronous (non-blocking).
at line 264
bool
isAsyncRequest()
Check if this is an asynchronous request (non-blocking).
at line 274
array
getPostParams()
Only return params on POST requests.
at line 288
array
getDefaultHeaders()
The default headers used with every request.