From 9d82f8a9ef1378999c5792d816f023a633c085f8 Mon Sep 17 00:00:00 2001
From: chandrusf Behaviours: gen_server. 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.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.
+
+Description
+
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.
-Exported Functions | |||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code_change/3 | |||||||||||||||||||||||||||||||||||||||||||||||
finished_async_request/0 | Internal export. | ||||||||||||||||||||||||||||||||||||||||||||||
handle_call/3 | |||||||||||||||||||||||||||||||||||||||||||||||
handle_cast/2 | |||||||||||||||||||||||||||||||||||||||||||||||
handle_info/2 | |||||||||||||||||||||||||||||||||||||||||||||||
init/1 | |||||||||||||||||||||||||||||||||||||||||||||||
reply/2 | Internal export. | ||||||||||||||||||||||||||||||||||||||||||||||
send_req/3 | This is the basic function to send a HTTP request. | ||||||||||||||||||||||||||||||||||||||||||||||
send_req/4 | Same as send_req/3. | ||||||||||||||||||||||||||||||||||||||||||||||
send_req/5 | Same as send_req/4. | ||||||||||||||||||||||||||||||||||||||||||||||
send_req/6 | Same as send_req/5. | ||||||||||||||||||||||||||||||||||||||||||||||
set_dest/3 | Sets options for a destination. | ||||||||||||||||||||||||||||||||||||||||||||||
shutting_down/0 | Internal export. | ||||||||||||||||||||||||||||||||||||||||||||||
start/0 | |||||||||||||||||||||||||||||||||||||||||||||||
start_link/0 | |||||||||||||||||||||||||||||||||||||||||||||||
stop/0 | |||||||||||||||||||||||||||||||||||||||||||||||
terminate/2 | |||||||||||||||||||||||||||||||||||||||||||||||
trace_off/0 | Turn tracing off for the ibrowse process. | ||||||||||||||||||||||||||||||||||||||||||||||
trace_off/2 | Turn tracing OFF for all connections to the specified HTTP
+
Exported Functions+Function Detailscode_change/3- -
+code_change(OldVsn, State, Extra) -> term() + finished_async_request/0- -
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(Req, From, State) -> term() + handle_cast/2- -
+handle_cast(Msg, State) -> term() + handle_info/2- -
+handle_info(Info, State) -> term() + init/1- -
+init(X1) -> term() + reply/2- -
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() +
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() +
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() +
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() +
Same as send_req/5. All timeout values are in milliseconds. set_dest/3- -
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- -
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_link/0- -
+start_link() -> term() + stop/0- -
+stop() -> term() + terminate/2- -
+terminate(Reason, State) -> term() + trace_off/0- -
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() Turn tracing OFF for all connections to the specified HTTP server. trace_on/0- -
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() +
Turn tracing on for all connections to the specified HTTP - server. Host is whatever is specified as the domain name in the URL - |