add_config/1 | Add additional configuration elements at runtime. |
+all_trace_off/0 | Turn Off ALL tracing. |
code_change/3 | |
get_config_value/1 | Internal export. |
get_config_value/2 | Internal export. |
+get_metrics/0 | |
+get_metrics/2 | |
handle_call/3 | |
handle_cast/2 | |
handle_info/2 | |
@@ -85,19 +88,19 @@ send_req/4, send_req/5, send_req/6.
send_req_direct/7 | Same as send_req/6 except that the first argument is the PID
returned by spawn_worker_process/2 or spawn_link_worker_process/2. |
set_dest/3 | Deprecated. |
+set_max_attempts/3 | Set the maximum attempts for each connection to a specific Host:Port. |
set_max_pipeline_size/3 | Set the maximum pipeline size for each connection to a specific Host:Port. |
set_max_sessions/3 | Set the maximum number of connections allowed to a specific Host:Port. |
show_dest_status/0 | Shows some internal information about load balancing. |
+show_dest_status/1 | |
show_dest_status/2 | Shows some internal information about load balancing to a
specified Host:Port. |
spawn_link_worker_process/1 | Same as spawn_worker_process/1 except the the calling process
is linked to the worker process which is spawned. |
-spawn_link_worker_process/2 | Same as spawn_worker_process/2 except the the calling process
- is linked to the worker process which is spawned. |
+spawn_link_worker_process/2 | Same as spawn_link_worker_process/1 except with Erlang process options. |
spawn_worker_process/1 | Creates a HTTP client process to the specified Host:Port which
is not part of the load balancing pool. |
-spawn_worker_process/2 | Same as spawn_worker_process/1 but takes as input a Host and Port
- instead of a URL. |
+spawn_worker_process/2 | Same as spawn_worker_process/1 except with Erlang process options. |
start/0 | Starts the ibrowse process without linking. |
start_link/0 | Starts the ibrowse process linked to the calling process. |
stop/0 | Stop the ibrowse process. |
@@ -118,9 +121,14 @@ send_req/4, send_req/5, send_req/6.
+
+
+
add_config(Terms) -> any()
+
Add additional configuration elements at runtime.
+
-
all_trace_off() -> ok
+
all_trace_off() -> ok
Turn Off ALL tracing
@@ -138,6 +146,16 @@ send_req/4, send_req/5, send_req/6.
get_config_value(Key, DefVal) -> any()
Internal export
+
+
+
get_metrics() -> any()
+
+
+
+
+
get_metrics(Host, Port) -> any()
+
+
handle_call(Request, From, State) -> any()
@@ -168,35 +186,20 @@ send_req/4, send_req/5, send_req/6.
-
rescan_config(File) -> any()
+
rescan_config(Terms) -> any()
This is the basic function to send a HTTP request.
The Status return value indicates the HTTP status code returned by the webserver
Same as send_req/3.
If a list is specified for the body it has to be a flat list. The body can also be a fun/0 or a fun/1.
If fun/0, the connection handling process will repeatdely call the fun until it returns an error or eof.
Fun() = {ok, Data} | eof
@@ -205,106 +208,13 @@ send_req/4, send_req/5, send_req/6.
send_req(Url::string(), Headers::headerList(), Method::method(), Body::body(), Options::optionList()) -> response()
-
- optionList() = [option()]
-- option() = {max_sessions, integer()} | {response_format, response_format()} | {stream_chunk_size, 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, srtf()} | {stream_to, stream_to()} | {http_vsn, {MajorVsn, MinorVsn}} | {host_header, string()} | {inactivity_timeout, integer()} | {connect_timeout, integer()} | {socket_options, Sock_opts} | {transfer_encoding, {chunked, ChunkSize}} | {headers_as_is, boolean()} | {give_raw_headers, boolean()} | {preserve_chunked_encoding, boolean()}
-- stream_to() = process() | {process(), once}
-- process() = pid() | atom()
-- username() = string()
-- password() = string()
-- SSLOpt = term()
-- Sock_opts = [Sock_opt]
-- Sock_opt = term()
-- ChunkSize = integer()
-- srtf() = boolean() | filename()
-- filename() = string()
-- response_format() = list | binary
-
-
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.
-
-
- - The
host_header
option is useful in the case where ibrowse is
- connecting to a component such as stunnel which then sets up a
- secure connection to a webserver. In this case, the URL supplied to
- ibrowse must have the stunnel host/port details, but that won't
- make sense to the destination webserver. This option can then be
- used to specify what should go in the Host
header in
- the request.
- - The
stream_to
option can be used to have the HTTP
- response streamed to a process as messages as data arrives on the
- socket. If the calling process wishes to control the rate at which
- data is received from the server, the option {stream_to,
- {process(), once}}
can be specified. The calling process
- will have to invoke ibrowse:stream_next(Request_id)
to
- receive the next packet.
-
- - When both the options
save_response_to_file
and stream_to
- are specified, the former takes precedence.
-
- - For the
save_response_to_file
option, the response body is saved to
- file only if the status code is in the 200-299 range. If not, the response body is returned
- as a string.
- - Whenever an error occurs in the processing of a request, ibrowse will return as much
- information as it has, such as HTTP Status Code and HTTP Headers. When this happens, the response
- is of the form
{error, {Reason, {stat_code, StatusCode}, HTTP_headers}}
-
- The inactivity_timeout
option is useful when
-dealing with large response bodies and/or slow links. In these
-cases, it might be hard to estimate how long a request will take to
-complete. In such cases, the client might want to timeout if no
-data has been received on the link for a certain time interval.
-
- This value is also used to close connections which are not in use for
- the specified timeout value.
-
-
- -
- The
connect_timeout
option is to specify how long the
- client process should wait for connection establishment. This is
- useful in scenarios where connections to servers are usually setup
- very fast, but responses might take much longer compared to
- connection setup. In such cases, it is better for the calling
- process to timeout faster if there is a problem (DNS lookup
- delays/failures, network routing issues, etc). The total timeout
- value specified for the request will enforced. To illustrate using
- an example:
-
- ibrowse:send_req("http://www.example.com/cgi-bin/request", [], get, [], [{connect_timeout, 100}], 1000).
-
- In the above invocation, if the connection isn't established within
- 100 milliseconds, the request will fail with
- {error, conn_failed}
.
- If connection setup succeeds, the total time allowed for the
- request to complete will be 1000 milliseconds minus the time taken
- for connection setup.
-
-
- - The
socket_options
option can be used to set
- specific options on the socket. The {active, true | false | once}
- and {packet_type, Packet_type}
will be filtered out by ibrowse.
-
- - The
headers_as_is
option is to enable the caller
- to send headers exactly as specified in the request without ibrowse
- adding some of its own. Required for some picky servers apparently.
-
- - The
give_raw_headers
option is to enable the
- caller to get access to the raw status line and raw unparsed
- headers. Not quite sure why someone would want this, but one of my
- users asked for it, so here it is.
-
- - The
preserve_chunked_encoding
option enables the caller
- to receive the raw data stream when the Transfer-Encoding of the server
- response is Chunked.
-
-
-
+
- optionList() = [option()]
- option() = {max_sessions, integer()} | {response_format, response_format()} | {stream_chunk_size, 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, srtf()} | {stream_to, stream_to()} | {http_vsn, {MajorVsn, MinorVsn}} | {host_header, string()} | {inactivity_timeout, integer()} | {connect_timeout, integer()} | {socket_options, Sock_opts} | {transfer_encoding, {chunked, ChunkSize}} | {headers_as_is, boolean()} | {give_raw_headers, boolean()} | {preserve_chunked_encoding, boolean()} | {workaround, head_response_with_body} | {worker_process_options, list()} | {return_raw_request, true} | {max_attempts, integer()}
- stream_to() = process() | {process(), once}
- process() = pid() | atom()
- username() = string()
- password() = string()
- SSLOpt = term()
- Sock_opts = [Sock_opt]
- Sock_opt = term()
- ChunkSize = integer()
- srtf() = boolean() | filename() | {append, filename()}
- filename() = string()
- response_format() = list | binary
+
Same as send_req/4.
Same as send_req/5.
All timeout values are in milliseconds.
@@ -338,14 +248,19 @@ data has been received on the link for a certain time interval.
Deprecated. Use set_max_sessions/3 and set_max_pipeline_size/3
for achieving the same effect.
+
+
+
set_max_attempts(Host::string(), Port::integer(), Max::integer()) -> ok
+
Set the maximum attempts for each connection to a specific Host:Port.
+
-
set_max_pipeline_size(Host::string(), Port::integer(), Max::integer()) -> ok
+
set_max_pipeline_size(Host::string(), Port::integer(), Max::integer()) -> ok
Set the maximum pipeline size for each connection to a specific Host:Port.
-
set_max_sessions(Host::string(), Port::integer(), Max::integer()) -> ok
+
set_max_sessions(Host::string(), Port::integer(), Max::integer()) -> ok
Set the maximum number of connections allowed to a specific Host:Port.
@@ -355,6 +270,11 @@ data has been received on the link for a certain time interval.
about workers spawned using spawn_worker_process/2 or
spawn_link_worker_process/2 is not included.
+
+
+
show_dest_status(Url) -> any()
+
+
show_dest_status(Host, Port) -> any()
@@ -365,19 +285,18 @@ data has been received on the link for a certain time interval.
-
spawn_link_worker_process(Url::string()) -> {ok, pid()}
+
spawn_link_worker_process(Url::string() | {Host::string(), Port::integer()}) -> {ok, pid()}
Same as spawn_worker_process/1 except the the calling process
is linked to the worker process which is spawned.
-
spawn_link_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
-
Same as spawn_worker_process/2 except the the calling process
- is linked to the worker process which is spawned.
+
spawn_link_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
+
Same as spawn_link_worker_process/1 except with Erlang process options.
-
spawn_worker_process(Url::string()) -> {ok, pid()}
+
spawn_worker_process(Url::string() | {Host::string(), Port::integer()}) -> {ok, pid()}
Creates a HTTP client process to the specified Host:Port which
is not part of the load balancing pool. This is useful in cases
where some requests to a webserver might take a long time whereas
@@ -388,14 +307,12 @@ data has been received on the link for a certain time interval.
is setup. The connection attempt is made only when the first
request is sent via any of the send_req_direct/4,5,6,7 functions.
Note: It is the responsibility of the calling process to control
- pipeline size on such connections.
-
+ pipeline size on such connections.
-
spawn_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
-
Same as spawn_worker_process/1 but takes as input a Host and Port
- instead of a URL.
+spawn_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
+Same as spawn_worker_process/1 except with Erlang process options.
@@ -404,7 +321,7 @@ data has been received on the link for a certain time interval.
-
start_link() -> {ok, pid()}
+
start_link() -> {ok, pid()}
Starts the ibrowse process linked to the calling process. Usually invoked by the supervisor ibrowse_sup
@@ -414,14 +331,14 @@ data has been received on the link for a certain time interval.
-
stop_worker_process(Conn_pid::pid()) -> ok
+
stop_worker_process(Conn_pid::pid()) -> ok
Terminate a worker process spawned using
spawn_worker_process/2 or spawn_link_worker_process/2. Requests in
progress will get the error response
{error, closing_on_request}
-
stream_close(Req_id::req_id()) -> ok | {error, unknown_req_id}
+
stream_close(Req_id::req_id()) -> ok | {error, unknown_req_id}
Tell ibrowse to close the connection associated with the
specified stream. Should be used in conjunction with the
stream_to
option. Note that all requests in progress on
@@ -430,7 +347,7 @@ data has been received on the link for a certain time interval.
-
stream_next(Req_id::req_id()) -> ok | {error, unknown_req_id}
+
stream_next(Req_id::req_id()) -> ok | {error, unknown_req_id}
Tell ibrowse to stream the next chunk of data to the
caller. Should be used in conjunction with the
stream_to
option
@@ -447,7 +364,7 @@ data has been received on the link for a certain time interval.
-
trace_off(Host, Port) -> ok
+
trace_off(Host, Port) -> ok
Turn tracing OFF for all connections to the specified HTTP
server.
@@ -459,14 +376,12 @@ data has been received on the link for a certain time interval.
trace_on(Host, Port) -> ok
-
- Host = string()
-- Port = integer()
-
+
- 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
-
Generated by EDoc, Nov 10 2010, 06:04:33.
+
Generated by EDoc, Nov 6 2015, 11:40:24.