Share via


MethodResponse Sınıf

Doğrudan yönteme verilen yanıtı temsil eder.

MethodResponse için Başlatıcı.

Devralma
builtins.object
MethodResponse

Oluşturucu

MethodResponse(request_id, status, payload=None)

Parametreler

Name Description
request_id
Gerekli
str

Yanıtlanan MethodRequest'in istek kimliği.

status
Gerekli
int

MethodRequest'in yürütülmesinin durumu.

payload
dict, str, int, float, bool veya None (<xref:JSON compatible values>)

Yanıtla birlikte gönderilecek JSON yükü. (İSTEĞE BAĞLı)

varsayılan değer: None

Değişkenler

Name Description
request_id
str

Yanıtlanan MethodRequest'in istek kimliği.

status
int

MethodRequest'in yürütülmesinin durumu.

payload

Yanıtla birlikte gönderilecek JSON yükü.

Yöntemler

create_from_method_request

MethodRequest'ten MethodResponse oluşturmak için fabrika yöntemi.

create_from_method_request

MethodRequest'ten MethodResponse oluşturmak için fabrika yöntemi.

create_from_method_request(method_request, status, payload=None)

Parametreler

Name Description
method_request
Gerekli
<xref:MethodRequest.>

Yanıt verecek MethodRequest nesnesi.

status
Gerekli
int

MethodRequest'in yürütülmesinin durumu.

payload
varsayılan değer: None