TelegramResponse
class TelegramResponse (View source)
Class TelegramResponse.
Handles the response from Telegram API.
Methods
Gets the relevant data from the Http client.
Return the original request that returned this response.
Gets the HTTP status code.
Gets the Request Endpoint used to get the response.
Return the bot access token that was used for this request.
Return the HTTP headers for this response.
Return the raw body response.
Return the decoded body response.
Checks if response is an error.
Throws the exception.
Instantiates an exception to be thrown later.
Returns the exception that was thrown for this request.
Converts raw API response to proper decoded response.
Details
at line 58
__construct(
TelegramRequest $request,
ResponseInterface|PromiseInterface $response)
Gets the relevant data from the Http client.
at line 83
TelegramRequest
getRequest()
Return the original request that returned this response.
at line 94
null|int
getHttpStatusCode()
Gets the HTTP status code.
Returns NULL if the request was asynchronous since we are not waiting for the response.
at line 104
string
getEndpoint()
Gets the Request Endpoint used to get the response.
at line 114
string|null
getAccessToken()
Return the bot access token that was used for this request.
at line 124
array
getHeaders()
Return the HTTP headers for this response.
at line 134
string
getBody()
Return the raw body response.
at line 144
array
getDecodedBody()
Return the decoded body response.
at line 154
bool
isError()
Checks if response is an error.
at line 164
throwException()
Throws the exception.
at line 172
makeException()
Instantiates an exception to be thrown later.
at line 182
TelegramSDKException
getThrownException()
Returns the exception that was thrown for this request.
at line 190
decodeBody()
Converts raw API response to proper decoded response.