Here are a few sample invocations.
ibrowse:send_req("http://intranet/messenger/", [], get).
ibrowse:send_req("http://www.google.com/", [], get, [],
[{proxy_user, "XXXXX"},
{proxy_password, "XXXXX"},
{proxy_host, "proxy"},
{proxy_port, 8080}], 1000).
ibrowse:send_req("http://www.erlang.org/download/otp_src_R10B-3.tar.gz", [], get, [],
[{proxy_user, "XXXXX"},
{proxy_password, "XXXXX"},
{proxy_host, "proxy"},
{proxy_port, 8080},
{save_response_to_file, true}], 1000).
ibrowse:set_dest("www.hotmail.com", 80, [{max_sessions, 10},
{max_pipeline_size, 1}]).
ibrowse:send_req("http://www.erlang.org", [], head).
ibrowse:send_req("http://www.sun.com", [], options).
ibrowse:send_req("http://www.bbc.co.uk", [], trace).
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 server. |
trace_on/0 | Turn tracing on for the ibrowse process. |
trace_on/2 | Turn tracing on for all connections to the specified HTTP server. |
code_change(Arg1, Arg2, Arg3) -> term()
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(Arg1, Arg2, Arg3) -> term()
handle_cast(Arg1, Arg2) -> term()
handle_info(Arg1, Arg2) -> term()
init(Arg1) -> term()
reply(Arg1, Arg2) -> 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(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(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(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(Url, Headers::headerList(), Method::method(), Body::body(), Options::optionList(), Timeout) -> response()
Same as send_req/5. All timeout values are in milliseconds.
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,
defaults will be used. Entries in ibrowse.conf look like this.
{dest, Host, Port, MaxSess, MaxPipe, Options}.
where
Host = string(). "www.erlang.org" | "193.180.168.23"
Port = integer()
MaxSess = integer()
MaxPipe = integer()
Options = optionList() -- see options in send_req/5
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() -> term()
start_link() -> term()
stop() -> term()
terminate(Arg1, Arg2) -> term()
trace_off() -> term()
Turn tracing off for the ibrowse process
trace_off(Host, Port) -> term()
Turn tracing OFF for all connections to the specified HTTP server.
trace_on() -> term()
Turn tracing on for the ibrowse process
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