From 9d82f8a9ef1378999c5792d816f023a633c085f8 Mon Sep 17 00:00:00 2001 From: chandrusf Date: Wed, 21 Mar 2007 00:36:09 +0000 Subject: [PATCH] Updated the doc --- doc/ibrowse.html | 181 ++++++++++++++++++++----------------------- doc/ibrowse_lib.html | 61 ++++++++------- 2 files changed, 114 insertions(+), 128 deletions(-) diff --git a/doc/ibrowse.html b/doc/ibrowse.html index b10c0cf..e294032 100644 --- a/doc/ibrowse.html +++ b/doc/ibrowse.html @@ -5,25 +5,25 @@ +

Module ibrowse

- - -

Description

-The ibrowse application implements an HTTP 1.1 client. This - module implements the API of the HTTP client. There is one named - process called 'ibrowse' which acts as a load balancer. There is - one process to handle one TCP connection to a webserver - (implemented in the module ibrowse_http_client). Multiple connections to a - webserver are setup based on the settings for each webserver. The - ibrowse process also determines which connection to pipeline a - certain request on. The functions to call are send_req/3, - send_req/4, send_req/5, send_req/6. +The ibrowse application implements an HTTP 1.1 client. + +

Behaviours: gen_server.

+ +

Description

The ibrowse application implements an HTTP 1.1 client. This +module implements the API of the HTTP client. There is one named +process called 'ibrowse' which acts as a load balancer. There is +one process to handle one TCP connection to a webserver +(implemented in the module ibrowse_http_client). Multiple connections to a +webserver are setup based on the settings for each webserver. The +ibrowse process also determines which connection to pipeline a +certain request on. The functions to call are send_req/3, +send_req/4, send_req/5, send_req/6.

Here are a few sample invocations.

- +

ibrowse:send_req("http://intranet/messenger/", [], get).

@@ -57,109 +57,99 @@ The ibrowse application implements an HTTP 1.1 client. This

ibrowse:send_req("http://www.google.com", [], get, [], [{stream_to, self()}]). -
+

A driver exists which implements URL encoding in C, but the speed achieved using only erlang has been good enough, so the driver isn't actually used.

-

Function Index

- - - - - - - - - - - - - - - - - - - - -
Exported Functions
code_change/3
finished_async_request/0Internal export.
handle_call/3
handle_cast/2
handle_info/2
init/1
reply/2Internal export.
send_req/3This is the basic function to send a HTTP request.
send_req/4Same as send_req/3.
send_req/5Same as send_req/4.
send_req/6Same as send_req/5.
set_dest/3Sets options for a destination.
shutting_down/0Internal export.
start/0
start_link/0
stop/0
terminate/2
trace_off/0Turn tracing off for the ibrowse process.
trace_off/2Turn tracing OFF for all connections to the specified HTTP + + + + + + + + + + + + + + + + + + + - - +
code_change/3
finished_async_request/0Internal export.
handle_call/3
handle_cast/2
handle_info/2
init/1
reply/2Internal export.
send_req/3This is the basic function to send a HTTP request.
send_req/4Same as send_req/3.
send_req/5Same as send_req/4.
send_req/6Same as send_req/5.
set_dest/3Sets options for a destination.
shutting_down/0Internal export.
start/0
start_link/0
stop/0
terminate/2
trace_off/0Turn tracing off for the ibrowse process.
trace_off/2Turn tracing OFF for all connections to the specified HTTP server.
trace_on/0Turn tracing on for the ibrowse process.
trace_on/2Turn tracing on for all connections to the specified HTTP +
trace_on/0Turn tracing on for the ibrowse process.
trace_on/2Turn tracing on for all connections to the specified HTTP server.
-

Exported Functions

+

Function Details

code_change/3

- -

code_change(Arg1, Arg2, Arg3) -> term()

-

+code_change(OldVsn, State, Extra) -> term() +

finished_async_request/0

- -

finished_async_request() -> term()

-

Internal export. Called by a HTTP connection process to +finished_async_request() -> term() +

Internal export. Called by a HTTP connection process to indicate to the load balancing process (ibrowse) that an asynchronous request has finished processing.

handle_call/3

- -

handle_call(Arg1, Arg2, Arg3) -> term()

-

+handle_call(Req, From, State) -> term() +

handle_cast/2

- -

handle_cast(Arg1, Arg2) -> term()

-

+handle_cast(Msg, State) -> term() +

handle_info/2

- -

handle_info(Arg1, Arg2) -> term()

-

+handle_info(Info, State) -> term() +

init/1

- -

init(Arg1) -> term()

-

+init(X1) -> term() +

reply/2

- -

reply(Arg1, Arg2) -> term()

-

Internal export. Called by a HTTP connection process to +reply(OrigCaller, Reply) -> term() +

Internal export. Called by a HTTP connection process to indicate to the load balancing process (ibrowse) that a synchronous request has finished processing.

send_req/3

- -

send_req(Url::string(), Headers::headerList(), Method::method()) -> response()

+

send_req(Url::string(), Headers::headerList(), Method::method()) -> response() +

This is the basic function to send a HTTP request. The Status return value indicates the HTTP status code returned by the webserver

send_req/4

- -

send_req(Url, Headers, Method::method(), Body::body()) -> response()

  • body() = [] | string() | binary()

+

send_req(Url, Headers, Method::method(), Body::body()) -> response() +

  • body() = [] | string() | binary()

Same as send_req/3. If a list is specified for the body it has to be a flat list.

send_req/5

- -

send_req(Url::string(), Headers::headerList(), Method::method(), Body::body(), Options::optionList()) -> response()

  • optionList() = [option()]
  • option() = {max_sessions, integer()} | {max_pipeline_size, integer()} | {trace, boolean()} | {is_ssl, boolean()} | {ssl_options, [SSLOpt]} | {pool_name, atom()} | {proxy_host, string()} | {proxy_port, integer()} | {proxy_user, string()} | {proxy_password, string()} | {use_absolute_uri, boolean()} | {basic_auth, {username(), password()}} | {cookie, string()} | {content_length, integer()} | {content_type, string()} | {save_response_to_file, boolean()} | {stream_to, process()} | {http_vsn, {MajorVsn, MinorVsn}} | {transfer_encoding, {chunked, ChunkSize}}
  • process() = pid() | atom()
  • username() = string()
  • password() = string()
  • SSLOpt = term()
  • ChunkSize = integer()

+

send_req(Url::string(), Headers::headerList(), Method::method(), Body::body(), Options::optionList()) -> response() +

  • optionList() = [option()]
  • option() = {max_sessions, integer()} | {max_pipeline_size, integer()} | {trace, boolean()} | {is_ssl, boolean()} | {ssl_options, [SSLOpt]} | {pool_name, atom()} | {proxy_host, string()} | {proxy_port, integer()} | {proxy_user, string()} | {proxy_password, string()} | {use_absolute_uri, boolean()} | {basic_auth, {username(), password()}} | {cookie, string()} | {content_length, integer()} | {content_type, string()} | {save_response_to_file, boolean()} | {stream_to, process()} | {http_vsn, {MajorVsn, MinorVsn}} | {transfer_encoding, {chunked, ChunkSize}}
  • process() = pid() | atom()
  • username() = string()
  • password() = string()
  • SSLOpt = term()
  • ChunkSize = integer()

Same as send_req/4. For a description of SSL Options, look in the ssl manpage. If the HTTP Version to use is not specified, the default is 1.1

send_req/6

- -

send_req(Url, Headers::headerList(), Method::method(), Body::body(), Options::optionList(), Timeout) -> response()

  • Timeout = integer() | infinity

+

send_req(Url, Headers::headerList(), Method::method(), Body::body(), Options::optionList(), Timeout) -> response() +

  • Timeout = integer() | infinity

Same as send_req/5. All timeout values are in milliseconds.

set_dest/3

- -

set_dest(Host::string(), Port::integer(), Opts::opt_list()) -> ok

+

set_dest(Host::string(), Port::integer(), Opts::opt_list()) -> ok +

Sets options for a destination. If the options have not been set in the ibrowse.conf file, it can be set using this function before sending the first request to the destination. If not, @@ -175,51 +165,44 @@ The ibrowse application implements an HTTP 1.1 client. This

shutting_down/0

- -

shutting_down() -> term()

-

Internal export. Called by a HTTP connection process to +shutting_down() -> term() +

Internal export. Called by a HTTP connection process to indicate to ibrowse that it is shutting down and further requests should not be sent it's way.

start/0

- -

start() -> term()

-

+start() -> term() +

start_link/0

- -

start_link() -> term()

-

+start_link() -> term() +

stop/0

- -

stop() -> term()

-

+stop() -> term() +

terminate/2

- -

terminate(Arg1, Arg2) -> term()

-

+terminate(Reason, State) -> term() +

trace_off/0

- -

trace_off() -> term()

-

Turn tracing off for the ibrowse process

+trace_off() -> term() +

Turn tracing off for the ibrowse process

trace_off/2

- -

trace_off(Host, Port) -> term()

+

trace_off(Host, Port) -> term()

Turn tracing OFF for all connections to the specified HTTP server.

trace_on/0

- -

trace_on() -> term()

-

Turn tracing on for the ibrowse process

+trace_on() -> term() +

Turn tracing on for the ibrowse process

trace_on/2

- -

trace_on(Host, Port) -> term()

  • Host = string()
  • Port = integer()

+

trace_on(Host, Port) -> term() +

  • Host = string()
  • Port = integer()

Turn tracing on for all connections to the specified HTTP - server. Host is whatever is specified as the domain name in the URL

- \ No newline at end of file + server. Host is whatever is specified as the domain name in the URL

+ + diff --git a/doc/ibrowse_lib.html b/doc/ibrowse_lib.html index ecc42ca..81a531f 100644 --- a/doc/ibrowse_lib.html +++ b/doc/ibrowse_lib.html @@ -5,48 +5,51 @@ -

Module ibrowse_lib

- -

Description

-Module with a few useful functions +

Module ibrowse_lib

+Module with a few useful functions. + +

Description

Module with a few useful functions

Function Index

- - - - - - - +
Exported Functions
decode_rfc822_date/1
drv_ue/1
drv_ue/2
status_code/1Given a status code, returns an atom describing the status code.
url_encode/1URL-encodes a string based on RFC 1738.
+ + + + +
dec2hex/2dec2hex taken from gtk.erl in std dist + M = integer() -- number of hex digits required + N = integer() -- the number to represent as hex.
decode_rfc822_date/1
drv_ue/1
drv_ue/2
status_code/1Given a status code, returns an atom describing the status code.
url_encode/1URL-encodes a string based on RFC 1738.
-

Exported Functions

+

Function Details

-

decode_rfc822_date/1

+

dec2hex/2

+

dec2hex(M::integer(), N::integer()) -> string()

+

dec2hex taken from gtk.erl in std dist + M = integer() -- number of hex digits required + N = integer() -- the number to represent as hex

-

decode_rfc822_date(Arg1) -> term()

-

+

decode_rfc822_date/1

+decode_rfc822_date(String) -> term() +

drv_ue/1

- -

drv_ue(Arg1) -> term()

-

+drv_ue(Str) -> term() +

drv_ue/2

- -

drv_ue(Arg1, Arg2) -> term()

-

+drv_ue(Str, Port) -> term() +

status_code/1

- -

status_code(StatusCode) -> StatusDescription

  • StatusCode = string() | integer()
  • StatusDescription = atom()

+

status_code(StatusCode::status_code()) -> StatusDescription +

Given a status code, returns an atom describing the status code.

url_encode/1

- -

url_encode(Str) -> UrlEncodedStr

  • Str = string()
  • UrlEncodedStr = string()

-

URL-encodes a string based on RFC 1738. Returns a flat list.

- \ No newline at end of file +

url_encode(Str) -> UrlEncodedStr +

  • Str = string()
  • UrlEncodedStr = string()

+

URL-encodes a string based on RFC 1738. Returns a flat list.

+ +