gdDocumentation0.8.0

API reference

GDHTTPResponse

Response holding the received HTTP status, headers, and body, returning strict JSON as a value and Err.

Properties

status : int
headers : Dictionary
body : PackedByteArray

Methods

ok

ok() -> bool

Return true for HTTP status codes from 200 through 299; transport success alone does not imply this result.

Parameters

No parameters.

Return value

bool

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

text

text() -> String

Decode body bytes as text, rejecting only conversions beyond the basic String representation.

Parameters

No parameters.

Return value

String

Errors

This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.

json

json() -> Variant, Err

Distinguish valid JSON null from parsing failure.

Parameters

No parameters.

Return value

Variant, Err

Errors

The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.