A GET response saved to file. A temporary file is created and the
filename returned. The response will only be saved to file if the
status code is in the 200 range. The directory to download to can
be set using the application env var download_dir - the default
is the current working directory:
Setting the size of the connection pool and pipeline. This sets the
number of maximum connections to the specified server to 10 and the pipeline
size to 1. Connections are assumed to be already setup.
11> ibrowse:set_dest("www.hotmail.com", 80, [{max_sessions, 10},
{max_pipeline_size, 1}]).
ok
62> ibrowse:send_req("http://www.sun.com", [], options).
{ok,"200",
[{"Server","Sun Java System Web Server 6.1"},
{"Date","Mon, 28 Feb 2005 04:44:39 GMT"},
{"Content-Length","0"},
{"P3p",
"policyref=\"http://www.sun.com/p3p/Sun_P3P_Policy.xml\", CP=\"CAO DSP COR CUR ADMa DEVa TAIa PSAa PSDa CONi TELi OUR SAMi PUBi IND PHY ONL PUR COM NAV INT DEM CNT STA POL PRE GOV\""},
{"Set-Cookie",
"SUN_ID=X.X.X.X:169191109565879; EXPIRES=Wednesday, 31-Dec-2025 23:59:59 GMT; DOMAIN=.sun.com; PATH=/"},
{"Allow",
"HEAD, GET, PUT, POST, DELETE, TRACE, OPTIONS, MOVE, INDEX, MKDIR, RMDIR"}],
[]}
ibrowse
ibrowse is a HTTP client written in erlang.
License: ibrowse is available under two different licenses. LGPL or the BSD license.
Comments to: chandrashekhar.mullaparthi@gmail.com
Current Version: 4.4.2
Latest Version: git://github.com/cmullaparthi/ibrowse.git
Features
Usage Examples
Remember to start ibrowse first:
Synchronous Requests
A simple
GETrequest:A
GETusing a proxy:A
GETresponse saved to file. A temporary file is created and the filename returned. The response will only be saved to file if the status code is in the200range. The directory to download to can be set using the application env vardownload_dir- the default is the current working directory:Setting the size of the connection pool and pipeline. This sets the number of maximum connections to the specified server to
10and the pipeline size to1. Connections are assumed to be already setup.Example using the
HEADmethod:Example using the
OPTIONSmethod:Asynchronous Requests
Example of an asynchronous
GETrequest:Another asynchronous
GETrequest:Example of request which fails when using the async option. Here the
{ibrowse_req_id, ReqId}is not returned. Instead the error code is returned.Other Examples
Example of request using both Proxy-Authorization and authorization by the final webserver:
Example of a
TRACErequest. Very interesting! yaws.hyber.org didn’t support this. Nor did www.google.com. But good old BBC supports this:A
GETusing a socks5: