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.
Details
at line 62
__construct(
string|null $accessToken = null,
string|null $method = null,
string|null $endpoint = null,
array $params = array(),
bool $isAsyncRequest = false)
Creates a new Request entity.
at line 83
TelegramRequest
setAccessToken(
string $accessToken)
Set the bot access token for this request.
at line 95
string|null
getAccessToken()
Return the bot access token for this request.
at line 105
validateAccessToken()
Validate that bot access token exists for this request.
at line 120
TelegramRequest
setMethod(
string $method)
Set the HTTP method for this request.
at line 132
string
getMethod()
Return the HTTP method for this request.
at line 142
validateMethod()
Validate that the HTTP method is set.
at line 160
TelegramRequest
setEndpoint(
string $endpoint)
Set the endpoint for this request.
at line 172
string
getEndpoint()
Return the API Endpoint for this request.
at line 184
TelegramRequest
setParams(
array $params = array())
Set the params for this request.
at line 196
array
getParams()
Return the params for this request.
at line 208
TelegramRequest
setHeaders(
array $headers)
Set the headers for this request.
at line 220
array
getHeaders()
Return the headers for this request.
at line 234
TelegramRequest
setAsyncRequest($isAsyncRequest)
Make this request asynchronous (non-blocking).
at line 246
bool
isAsyncRequest()
Check if this is an asynchronous request (non-blocking).
at line 256
array
getPostParams()
Only return params on POST requests.
at line 270
array
getDefaultHeaders()
The default headers used with every request.