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: intbody: Variantheaders: Dictionarytype: String
Methods
set_status(status: int) -> voidset_body(body: Variant) -> voidset_headers(headers: Dictionary) -> void
set_status
set_status(status: int) -> voidSet the status code checked before transmission.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
status | int | Required | HTTP 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) -> voidReplace the reply body before it is sent.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
body | Variant | Required | Content 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) -> voidReplace additional response headers.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
headers | Dictionary | Required | Response 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.