Response (object)

July 2, 2016 ยท View on GitHub

API categories | API index

Response (object)

This object is passed as parameter to RequestHandler.OnBeforeResourceLoad() and RequestHandler.OnResourceResponse().

Table of contents:

Methods

IsReadOnly

Returnbool

Returns true if this object is read-only.

GetStatus

Returnint

Get the response status code.

SetStatus

ParameterType
statusint
Returnvoid

Set the response status code.

GetStatusText

Returnstring

Get the response status text.

SetStatusText

ParameterType
statusTextstring
Returnvoid

Set the response status text.

GetMimeType

Returnstring

Get the response mime type.

SetMimeType

ParameterType
mimeTypestring
Returnvoid

Set the response mime type.

GetHeader

ParameterType
namestring
Returnstring

Get the value for the specified response header field.

GetHeaderMap

Returndict

Get all header fields with duplicate keys overwritten by last.

GetHeaderMultimap

Returnlist

Get all header fields. Returns list of tuples (name, value). Headers may have duplicate keys, if you want to ignore duplicates use GetHeaderMap().

SetHeaderMap

ParameterType
headerMapdict
Returnvoid

Set all header fields.

SetHeaderMultimap

ParameterType
headerMultimaplist
Returnvoid

Set all header fields. headerMultimap must be a list of tuples (name, value).