Class HttpResponse

Superclasses :
lang::Object
Package :
http

This class encapsulates an HTTP response.

Source

Class summary
Methods inherited from lang::Object
clone(seen) equals(other, seen) get_class() get_class_name() get_id() hash_code(depth, seen) is_instance(name) to_string(depth, seen)
Methods defined in this class
add_header(key, val) get_data() get_data_file() get_first_header(key) get_headers(key) get_status() get_string_list() initially() set_data(s) set_data_file(s) set_status(s) set_url(url) status_okay()
Variables defined in this class
data data_file headers status url

Method detail

add_header(key, val)

Add a response header with the given key, after any existing ones with the same key
Source

get_data()

Return the data.
Returns :
A string representing the data (which may be binary data).
Source

get_data_file()

Return the data file for this response, or null if there is no such file.
Returns :
The filename
Source

get_first_header(key)

A convenience function to get the first header matching the given key, or fail
Source

get_headers(key)

Get all the headers for the key, or fail if the key has no headers
Fails :
if no headers for the key have been defined
Returns :
a list of all the headers for the key. This will always be a non-empty list.
Source

get_status()

Return the status of the page
Returns :
The status eg "HTTP/1.1 200 OK"
Source

get_string_list()

Return a list of strings, created by converting the data into a list of newline separated strings.
Returns :
A list of strings.
Source

initially()


set_data(s)

Set the data of the response.
Source

set_data_file(s)

Set the data file for responses that save the data in a file, rather than as part of this object.
Parameters :
s - the filename.
Source

set_status(s)

Set the status
Source

set_url(url)

Set the url
Source

status_okay()

Succeed iff the status was an HTTP OK status.
Source

Variable detail

data


data_file


headers


status


url