res://addons/w4gd/rest-client/client_result.gd

Inherits: RefCounted

Inherited By: res://addons/w4gd/rest-client/client_async_result.gd, res://addons/w4gd/rest-client/client_blocking_result.gd

The result of an HTTP request.

Properties

PackedByteArray

body

PackedStringArray

headers

int

http_request_result

0

int

http_status_code

0

JSON

json_parser

ResultStatus

result_status

1

Methods

PackedByteArray

bytes_result ( )

Dictionary

dict_headers ( )

int

get_http_status_code ( )

bool

is_error ( )

bool

is_http_error ( )

bool

is_http_redirect ( )

bool

is_http_success ( )

bool

is_pending ( )

void

json_result ( )

String

text_result ( )


Enumerations

enum ResultStatus:

ResultStatus DONE = 0

ResultStatus PENDING = 1

ResultStatus CANCELLED = 2

ResultStatus ERROR = 3


Property Descriptions

PackedByteArray body

There is currently no description for this property.


PackedStringArray headers

There is currently no description for this property.


int http_request_result = 0

There is currently no description for this property.


int http_status_code = 0

There is currently no description for this property.


JSON json_parser

There is currently no description for this property.


ResultStatus result_status = 1

There is currently no description for this property.


Method Descriptions

PackedByteArray bytes_result ( )

Returns the response body as bytes.


Dictionary dict_headers ( )

Returns a Dictionary of the response headers.


int get_http_status_code ( )

Returns the HTTP status code of the response.


bool is_error ( )

Returns true if the request resulted in an error; otherwise, false.


bool is_http_error ( )

Returns true if the response is an HTTP error; otherwise, false.


bool is_http_redirect ( )

Returns true if the response is an HTTP redirect; otherwise, false.


bool is_http_success ( )

Returns true if the response is an HTTP success; otherwise, false.


bool is_pending ( )

Returns true if the request is still pending; otherwise, false.


void json_result ( )

Parses the response body as JSON and returns it.


String text_result ( )

Returns the response body as a UTF-8 string.