Class HttpClient

Superclasses :
net::NetClient
Package :
http

An http client

Source

Class summary
Methods inherited from net::NetClient
close() error_and_close(a) open() read_line() read_str(len) recv(len) send(s) set_port(n) set_server(s) set_timeout(timeout) write_line(s) write_str(s)
Variables inherited from net::NetClient
connection port sbuff server timeout
Methods inherited from util::Connectable
connect(obj, meth, type) disconnect(l) fire(type, param) fire_event(e)
Variables inherited from util::Connectable
listeners
Methods inherited from util::Error
error(a) get_reason()
Variables inherited from util::Error
reason
Methods inherited from util::SetFields
as_attrib(attr, val) attrib(a[]) cset_val(attr, val) field_error(s) int_val(attr, val) int_vals(attr, val, n) numeric_val(attr, val) numeric_vals(attr, val, n) set_fields(l) string_val(attr, val) string_vals(attr, val, n) test_flag(attr, val)
Methods defined in this class
add_some(s) clear_keep_alive() create_authorization_header() create_basic_authorization_header() create_cookie_header() create_digest_authorization_header() dump_cookies() get_http_error() get_length() get_read() handle_authentication() handle_redirect() initially() maybe_close() maybe_open() on_http_error(s) parse_cookie_string(s) parse_generic_header(s) parse_quoted_string() read_chunked() read_data() read_data_impl() read_headers() read_length() read_to_eof() retrieve(request) retrieve_page() set_http_version(s) set_keep_alive() set_one(attr, val) set_retries(retries) set_user_agent(s) setup_basic_authentication(t) setup_digest_authentication(t) store_cookies() tryone() unq(s) write_request() write_request_headers()
Variables defined in this class
auth_req_count auth_scheme basic_auth_header cnonce cookies data_out ha1 http_error http_version keep_alive_flag length nonce nonce_count opaque open_url qop read realm redir_set request result retries string_buff user_agent

Method detail

add_some(s)

Private method, not intended for client invocation

clear_keep_alive()

Configure the client to NOT use the keep-alive feature.
Source

create_authorization_header()

Private method, not intended for client invocation

create_basic_authorization_header()

Private method, not intended for client invocation

create_cookie_header()

Private method, not intended for client invocation

create_digest_authorization_header()

Private method, not intended for client invocation

dump_cookies()

Private method, not intended for client invocation

get_http_error()

After invoking retrieve(), this method can be used to determine whether a failure was caused by a network failure or an HTTP failure (for example 404 not found). In the former case, &null is returned; in the latter case the error string is returned.
Source

get_length()

Return the length of the current download, or &null if unknown
Source

get_read()

Return the number of bytes read so far.
Source

handle_authentication()

Private method, not intended for client invocation

handle_redirect()

Private method, not intended for client invocation

initially()

Overrides initially() in util::Connectable

maybe_close()

Private method, not intended for client invocation

maybe_open()

Private method, not intended for client invocation

on_http_error(s)

Private method, not intended for client invocation

parse_cookie_string(s)

Private method, not intended for client invocation

parse_generic_header(s)

Private method, not intended for client invocation

parse_quoted_string()

Private method, not intended for client invocation

read_chunked()

Private method, not intended for client invocation

read_data()

Private method, not intended for client invocation

read_data_impl()

Private method, not intended for client invocation

read_headers()

Private method, not intended for client invocation

read_length()

Private method, not intended for client invocation

read_to_eof()

Private method, not intended for client invocation

retrieve(request)

Retrieve the given HttpRequest request, or fail if that is not possible.
Parameters :
request - - an HttpRequest instance
Returns :
an HttpResponse object.
Source

retrieve_page()

Private method, not intended for client invocation

set_http_version(s)

Set the http version to use; by default "1.0"
Source

set_keep_alive()

Configure the client to use the keep-alive feature (the default).
Source

set_one(attr, val)

Overrides set_one(attr, val) in util::SetFields
Source

set_retries(retries)

Set the number of retries to use. The default is two.
Source

set_user_agent(s)

Set the user-agent identification
Source

setup_basic_authentication(t)

Private method, not intended for client invocation

setup_digest_authentication(t)

Private method, not intended for client invocation

store_cookies()

Private method, not intended for client invocation

tryone()

Retrieve the given url. A HttpResponse object is returned upon success. Failure occurs if the url could not be retrieved.
Source

unq(s)

Private method, not intended for client invocation

write_request()

Private method, not intended for client invocation

write_request_headers()

Private method, not intended for client invocation

Variable detail

auth_req_count


auth_scheme


basic_auth_header


cnonce


cookies


data_out


ha1


http_error


http_version


keep_alive_flag


length


nonce


nonce_count


opaque


open_url


qop


read


realm


redir_set


request


result


retries


string_buff


user_agent