HttpResponse

Represents an HTTP response received from a remote server.

Summary

Properties

Name Type
status int
body string
headers table

Methods

Method Returns
GetHeader(header: string) string
HasHeader(header: string) bool

Properties

status

int

The HTTP status of the response.

body

string

A string containing the response body data.

headers

table

An associative table containing all the response headers.

Methods

GetHeader

GetHeader(header: string): string

Gets the value of a header with the specified name from the HTTP response. If the header is not found it returns an empty string.

Parameters

Name Type Description
header string The header name (eg. Content-Type).

Returns

Type Description
string

HasHeader

HasHeader(header: string): bool

Checks if a header with the specified name exists in the HTTP response.

Parameters

Name Type Description
header string The header name (eg. Content-Type).

Returns

Type Description
bool
Last modified April 27, 2020: Regenerate all API documentation (0b49d6be)