Response
Web server response
Operations
- New
- AddCookie
- GetCode
- GetContent
- GetCookie
- GetCookies
- GetForwardAlias
- GetHeader
- GetHeaders
- GetReason
- GetStringContent
- HasContent
- HasForwardAlias
- HasHeader
- HasStaticHandler
- RemoveCookie
- RemoveHeader
- SetCode
- SetCodeContent
- SetCodeContentCompression
- SetCodeType
- SetCodeTypeContent
- SetCompression
- SetContent
- SetContentCompression
- SetContentType
- SetForwardAlias
- SetHeader
- SetReason
- ToString
AddCookie
Adds a cookie
method : public : AddCookie(cookie:Cookie) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| cookie | Cookie | cookie |
GetContent
Get the response content
method : public : GetContent() ~ Byte[]Return
| Type | Description |
|---|---|
| Byte | response content |
GetCookie
Updates a cookie
method : public : GetCookie(name:String) ~ CookieParameters
| Name | Type | Description |
|---|---|---|
| name | String | cookie name |
GetCookies
Gets all cookies
method : public : GetCookies() ~ Vector<Cookie>Return
| Type | Description |
|---|---|
| Vector<Cookie> | all cookies |
GetForwardAlias
Gets the forward page alias
method : public : GetForwardAlias() ~ StringReturn
| Type | Description |
|---|---|
| String | forward page alias |
GetHeader
Gets a response header
method : public : GetHeader(name:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| name | String | header name |
Return
| Type | Description |
|---|---|
| String | response header |
GetHeaders
Gets response headers
method : public : GetHeaders() ~ Map<String,String>Return
| Type | Description |
|---|---|
| Map<String,String> | response headers |
GetReason
Get the reason string
method : public : GetReason() ~ StringReturn
| Type | Description |
|---|---|
| String | reason sting |
GetStringContent
Get the response content as string
method : public : GetStringContent() ~ StringReturn
| Type | Description |
|---|---|
| String | response content as string |
HasContent
Checks for request body content
method : public : HasContent() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if content exists, false otherwise |
HasForwardAlias
Checks the forward page alias
method : public : HasForwardAlias() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if forward page alias exists, false otherwise |
HasHeader
Check for a response header
method : public : HasHeader(name:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| name | String | header name |
Return
| Type | Description |
|---|---|
| Bool | true if header exists, false otherwise |
HasStaticHandler
Check to see if the response has configured handler
method : public : HasStaticHandler() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if handler exists, false otherwise |
New
Constructor
New(server_config:WebServerConfig, request_path:String)Parameters
| Name | Type | Description |
|---|---|---|
| server_config | WebServerConfig | web server configuration |
| request_path | String | HTTP request path |
RemoveCookie
Removes a cookie
method : public : RemoveCookie(name:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| name | String | cookie name |
RemoveHeader
Removed a response header
method : public : RemoveHeader(name:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| name | String | header name |
SetCode
Set response code
method : public : SetCode(code:Int) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | response code |
SetCodeContent
Set response code and content
method : public : SetCodeContent(code:Int, content:Byte[]) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | response code |
| content | Byte | response content |
SetCodeContent
Set response code and content
method : public : SetCodeContent(code:Int, content:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | response code |
| content | String | response content |
SetCodeContentCompression
Set response code, content and compression type
method : public : SetCodeContentCompression(code:Int, content:String, compression:Compression) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | response code |
| content | String | response content |
| compression | Compression | response compression (br = Brotli, deflate = zlib, gzip = GNU zip) |
SetCodeContentCompression
Set response code, content and compression type
method : public : SetCodeContentCompression(code:Int, content:Byte[], compression:Compression) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | response code |
| content | Byte | response content |
| compression | Compression | response compression (br = Brotli, deflate = zlib, gzip = GNU zip) |
SetCodeType
Set response code and type
method : public : SetCodeType(code:Int, type:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | response code |
| type | String | content type |
SetCodeTypeContent
Set response code, type and content
method : public : SetCodeTypeContent(code:Int, type:String, content:Byte[]) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | response code |
| type | String | content type |
| content | Byte | response content |
SetCodeTypeContent
Set response code and content
method : public : SetCodeTypeContent(code:Int, type:String, content:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| code | Int | response code |
| type | String | content type |
| content | String | response content |
SetCompression
Set the response compression, should be called after the content is set
method : public : SetCompression(compression:Compression) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| compression | Compression | response compression (br = Brotli, deflate = zlib, gzip = GNU zip) |
SetContent
Set response content
method : public : SetContent(content:Byte[]) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| content | Byte | response content |
SetContent
Set response code
method : public : SetContent(content:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| content | String | response content |
SetContentCompression
Set content and compression type
method : public : SetContentCompression(content:String, compression:Compression) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| content | String | response content |
| compression | Compression | response compression (br = Brotli, deflate = zlib, gzip = GNU zip) |
SetContentCompression
Set content and compression type
method : public : SetContentCompression(content:Byte[], compression:Compression) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| content | Byte | response content |
| compression | Compression | response compression (br = Brotli, deflate = zlib, gzip = GNU zip) |
SetContentType
Sets the content type
method : public : SetContentType(type:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| type | String | content type |
SetForwardAlias
Set the forward page alias
method : public : SetForwardAlias(name:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| name | String | forward page alias |
Return
| Type | Description |
|---|---|
| Bool | true if set, false otherwise |
SetHeader
Sets a response header
method : public : SetHeader(name:String, value:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| name | String | header name |
| value | String | header value |
SetReason
Set response reason
method : public : SetReason(reason:String) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| reason | String | response reason |
ToString
Get the reason string
method : public : ToString() ~ StringReturn
| Type | Description |
|---|---|
| String | reason sting |