PHP 클래스 Telegram\Bot\TelegramResponse

Handles the response from Telegram API.
파일 보기 프로젝트 열기: irazasyed/telegram-bot-sdk 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$body The raw body of the response from API request.
$decodedBody The decoded body of the API response.
$endPoint API Endpoint used to make the request.
$headers The headers returned from API request.
$httpStatusCode The HTTP status code response from API.
$request The original request that returned this response.
$thrownException The exception thrown by this request.

공개 메소드들

메소드 설명
__construct ( Telegram\Bot\TelegramRequest $request, Psr\Http\Message\ResponseInterface | GuzzleHttp\Promise\PromiseInterface $response ) Gets the relevant data from the Http client.
decodeBody ( ) Converts raw API response to proper decoded response.
getAccessToken ( ) : string | null Return the bot access token that was used for this request.
getBody ( ) : string Return the raw body response.
getDecodedBody ( ) : array Return the decoded body response.
getEndpoint ( ) : string Gets the Request Endpoint used to get the response.
getHeaders ( ) : array Return the HTTP headers for this response.
getHttpStatusCode ( ) : null | integer Gets the HTTP status code.
getRequest ( ) : Telegram\Bot\TelegramRequest Return the original request that returned this response.
getResult ( ) : mixed Helper function to return the payload of a successful response.
getThrownException ( ) : Telegram\Bot\Exceptions\TelegramSDKException Returns the exception that was thrown for this request.
isError ( ) : boolean Checks if response is an error.
makeException ( ) Instantiates an exception to be thrown later.
throwException ( ) Throws the exception.

메소드 상세

__construct() 공개 메소드

Gets the relevant data from the Http client.
public __construct ( Telegram\Bot\TelegramRequest $request, Psr\Http\Message\ResponseInterface | GuzzleHttp\Promise\PromiseInterface $response )
$request Telegram\Bot\TelegramRequest
$response Psr\Http\Message\ResponseInterface | GuzzleHttp\Promise\PromiseInterface

decodeBody() 공개 메소드

Converts raw API response to proper decoded response.
public decodeBody ( )

getAccessToken() 공개 메소드

Return the bot access token that was used for this request.
public getAccessToken ( ) : string | null
리턴 string | null

getBody() 공개 메소드

Return the raw body response.
public getBody ( ) : string
리턴 string

getDecodedBody() 공개 메소드

Return the decoded body response.
public getDecodedBody ( ) : array
리턴 array

getEndpoint() 공개 메소드

Gets the Request Endpoint used to get the response.
public getEndpoint ( ) : string
리턴 string

getHeaders() 공개 메소드

Return the HTTP headers for this response.
public getHeaders ( ) : array
리턴 array

getHttpStatusCode() 공개 메소드

Returns NULL if the request was asynchronous since we are not waiting for the response.
public getHttpStatusCode ( ) : null | integer
리턴 null | integer

getRequest() 공개 메소드

Return the original request that returned this response.
public getRequest ( ) : Telegram\Bot\TelegramRequest
리턴 Telegram\Bot\TelegramRequest

getResult() 공개 메소드

Helper function to return the payload of a successful response.
public getResult ( ) : mixed
리턴 mixed

getThrownException() 공개 메소드

Returns the exception that was thrown for this request.
public getThrownException ( ) : Telegram\Bot\Exceptions\TelegramSDKException
리턴 Telegram\Bot\Exceptions\TelegramSDKException

isError() 공개 메소드

Checks if response is an error.
public isError ( ) : boolean
리턴 boolean

makeException() 공개 메소드

Instantiates an exception to be thrown later.
public makeException ( )

throwException() 공개 메소드

Throws the exception.
public throwException ( )

프로퍼티 상세

$body 보호되어 있는 프로퍼티

The raw body of the response from API request.
protected $body

$decodedBody 보호되어 있는 프로퍼티

The decoded body of the API response.
protected $decodedBody

$endPoint 보호되어 있는 프로퍼티

API Endpoint used to make the request.
protected $endPoint

$headers 보호되어 있는 프로퍼티

The headers returned from API request.
protected $headers

$httpStatusCode 보호되어 있는 프로퍼티

The HTTP status code response from API.
protected $httpStatusCode

$request 보호되어 있는 프로퍼티

The original request that returned this response.
protected $request

$thrownException 보호되어 있는 프로퍼티

The exception thrown by this request.
protected $thrownException