gdDocumentation0.8.0

API reference

GDWebResponse

The HTTP response returned by GD.web.text, html, json, bytes, and stream. Its status and body can be changed, while type exposes Content-Type. The headers property includes extra fields and Content-Type; use GD.web.header to add a field.

status accepts 100..999. A value outside that range is sent as 500.

Properties

status : int
body : Variant
headers : Dictionary
type : String

Methods

set_status

set_status(status: int) -> void

Set the status code checked before transmission.

Parameters

NameTypeDefaultDescription
statusintRequiredHTTP response status code.

Return value

void

No value is returned.

Errors

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

set_body

set_body(body: Variant) -> void

Replace the reply body before it is sent.

Parameters

NameTypeDefaultDescription
bodyVariantRequiredContent to write or include in the response.

Return value

void

No value is returned.

Errors

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

set_headers

set_headers(headers: Dictionary) -> void

Replace additional response headers.

Parameters

NameTypeDefaultDescription
headersDictionaryRequiredResponse header names and their values.

Return value

void

No value is returned.

Errors

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