{"id":27594464,"url":"https://github.com/apache/couchdb-ibrowse","last_synced_at":"2025-10-29T07:05:43.665Z","repository":{"id":13307252,"uuid":"15993613","full_name":"apache/couchdb-ibrowse","owner":"apache","description":"Mirror of Apache CouchDB","archived":false,"fork":false,"pushed_at":"2024-05-22T19:50:38.000Z","size":833,"stargazers_count":5,"open_issues_count":1,"forks_count":12,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-04-10T11:58:44.409Z","etag":null,"topics":["big-data","cloud","content","couchdb","cplusplus","database","erlang","http","javascript","network-client","network-server"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-17T08:00:08.000Z","updated_at":"2024-06-05T08:11:35.000Z","dependencies_parsed_at":"2022-07-10T21:46:11.277Z","dependency_job_id":null,"html_url":"https://github.com/apache/couchdb-ibrowse","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-ibrowse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-ibrowse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-ibrowse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-ibrowse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/couchdb-ibrowse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248666597,"owners_count":21142271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["big-data","cloud","content","couchdb","cplusplus","database","erlang","http","javascript","network-client","network-server"],"created_at":"2025-04-22T10:32:59.604Z","updated_at":"2025-10-29T07:05:38.621Z","avatar_url":"https://github.com/apache.png","language":"Erlang","readme":"# ibrowse [![Build Status](https://secure.travis-ci.org/cmullaparthi/ibrowse.svg?branch=master)](http://travis-ci.org/cmullaparthi/ibrowse)\n\nibrowse is a HTTP client written in erlang.\n\n**License:** ibrowse is available under two different licenses.\n  LGPL or the BSD license.\n\n**Comments to:** chandrashekhar.mullaparthi@gmail.com\n\n**Current Version:** 4.4.2\n\n**Latest Version:** git://github.com/cmullaparthi/ibrowse.git\n\n\n\n## Features\n\n*  [RFC2616](http://www.ietf.org/rfc/rfc2616.txt) compliant (AFAIK)\n*  supports GET, POST, OPTIONS, HEAD, PUT, DELETE, TRACE,\n   MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, MOVE and COPY\n*  Understands HTTP/0.9, HTTP/1.0 and HTTP/1.1\n*  Understands chunked encoding\n*  Can generate requests using [Chunked Transfer-Encoding](http://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n*  Pools of connections to each webserver\n*  Pipelining support\n*  Download to file\n*  Asynchronous requests. Responses are streamed to a process\n*  Basic authentication\n*  Supports proxy authentication\n*  Supports SOCKS5\n    * Authentication methods 0 (No authentication) and 2(Username/password) supported\n*  Can talk to secure webservers using SSL\n*  *Any other features in the code not listed here :)*\n\n\n\n## Usage Examples\n\nRemember to start ibrowse first:\n\n```erlang\n5\u003e ibrowse:start().\n{ok,\u003c0.94.0\u003e}\n```\n\n\n\n### Synchronous Requests\n\nA simple `GET` request:\n\n```erlang\n6\u003e ibrowse:send_req(\"http://intranet/messenger/\", [], get).\n{ok,\"200\",\n    [{\"Server\",\"Microsoft-IIS/5.0\"},\n     {\"Content-Location\",\"http://intranet/messenger/index.html\"},\n     {\"Date\",\"Fri, 17 Dec 2004 15:16:19 GMT\"},\n     {\"Content-Type\",\"text/html\"},\n     {\"Accept-Ranges\",\"bytes\"},\n     {\"Last-Modified\",\"Fri, 17 Dec 2004 08:38:21 GMT\"},\n     {\"Etag\",\"\\\"aa7c9dc313e4c41:d77\\\"\"},\n     {\"Content-Length\",\"953\"}],\n    \"\u003chtml\u003e...\u003c/html\u003e\"}\n```\n\n\nA `GET` using a proxy:\n\n```erlang\n7\u003e ibrowse:send_req(\"http://www.google.com/\", [], get, [],\n                 [{proxy_user, \"XXXXX\"},\n                  {proxy_password, \"XXXXX\"},\n                  {proxy_host, \"proxy\"},\n                  {proxy_port, 8080}], 1000).\n{ok,\"302\",\n    [{\"Date\",\"Fri, 17 Dec 2004 15:22:56 GMT\"},\n     {\"Content-Length\",\"217\"},\n     {\"Content-Type\",\"text/html\"},\n     {\"Set-Cookie\",\n      \"PREF=ID=f58155c797f9...\"},\n     {\"Server\",\"GWS/2.1\"},\n     {\"Location\",\n      \"http://www.google.co.uk/cxfer?c=PREF%3D:TM%3D110329...\"},\n     {\"Via\",\"1.1 netapp01 (NetCache NetApp/5.5R2)\"}],\n    \"\u003cHTML\u003e...\u003c/HTML\u003e\\r\\n\"}\n```\n\n\nA `GET` response saved to file. A temporary file is created and the\nfilename returned. The response will only be saved to file if the\nstatus code is in the `200` range. The directory to download to can\nbe set using the application env var `download_dir` - the default\nis the current working directory:\n\n```erlang\n8\u003e ibrowse:send_req(\"http://www.erlang.se/\", [], get, [],\n                 [{proxy_user, \"XXXXX\"},\n                  {proxy_password, \"XXXXX\"},\n                  {proxy_host, \"proxy\"},\n                  {proxy_port, 8080},\n                  {save_response_to_file, true}], 1000).\n{error,req_timedout}\n\n9\u003e ibrowse:send_req(\"http://www.erlang.se/\", [], get, [],\n                 [{proxy_user, \"XXXXX\"},\n                  {proxy_password, \"XXXXX\"},\n                  {proxy_host, \"proxy\"},\n                  {proxy_port, 8080},\n                  {save_response_to_file, true}], 5000).\n{ok,\"200\",\n    [{\"Transfer-Encoding\",\"chunked\"},\n     {\"Date\",\"Fri, 17 Dec 2004 15:24:36 GMT\"},\n     {\"Content-Type\",\"text/html\"},\n     {\"Server\",\"Apache/1.3.9 (Unix)\"},\n     {\"Via\",\"1.1 netapp01 (NetCache NetApp/5.5R2)\"}],\n    {file,\"/Users/chandru/code/ibrowse/src/ibrowse_tmp_file_1103297041125854\"}}\n```\n\n\nSetting the size of the connection pool and pipeline. This sets the\nnumber of maximum connections to the specified server to `10` and the pipeline\nsize to `1`. Connections are assumed to be already setup.\n\n```erlang\n11\u003e ibrowse:set_dest(\"www.hotmail.com\", 80, [{max_sessions, 10},\n                                             {max_pipeline_size, 1}]).\nok\n```\n\n\nExample using the `HEAD` method:\n\n```erlang\n56\u003e ibrowse:send_req(\"http://www.erlang.org\", [], head).\n{ok,\"200\",\n    [{\"Date\",\"Mon, 28 Feb 2005 04:40:53 GMT\"},\n     {\"Server\",\"Apache/1.3.9 (Unix)\"},\n     {\"Last-Modified\",\"Thu, 10 Feb 2005 09:31:23 GMT\"},\n     {\"Etag\",\"\\\"8d71d-1efa-420b29eb\\\"\"},\n     {\"Accept-ranges\",\"bytes\"},\n     {\"Content-Length\",\"7930\"},\n     {\"Content-Type\",\"text/html\"}],\n    []}\n```\n\n\nExample using the `OPTIONS` method:\n\n```erlang\n62\u003e ibrowse:send_req(\"http://www.sun.com\", [], options).\n{ok,\"200\",\n    [{\"Server\",\"Sun Java System Web Server 6.1\"},\n     {\"Date\",\"Mon, 28 Feb 2005 04:44:39 GMT\"},\n     {\"Content-Length\",\"0\"},\n     {\"P3p\",\n      \"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\\\"\"},\n     {\"Set-Cookie\",\n      \"SUN_ID=X.X.X.X:169191109565879; EXPIRES=Wednesday, 31-Dec-2025 23:59:59 GMT; DOMAIN=.sun.com; PATH=/\"},\n     {\"Allow\",\n      \"HEAD, GET, PUT, POST, DELETE, TRACE, OPTIONS, MOVE, INDEX, MKDIR, RMDIR\"}],\n    []}\n```\n\n\n\n### Asynchronous Requests\n\nExample of an asynchronous `GET` request:\n\n```erlang\n18\u003e ibrowse:send_req(\"http://www.google.com\", [], get, [],\n                     [{proxy_user, \"XXXXX\"},\n                      {proxy_password, \"XXXXX\"},\n                      {proxy_host, \"proxy\"},\n                      {proxy_port, 8080},\n                      {stream_to, self()}]).\n{ibrowse_req_id,{1115,327256,389608}}\n\n19\u003e flush().\nShell got {ibrowse_async_headers,{1115,327256,389608},\n           \"302\",\n           [{\"Date\",\"Thu, 05 May 2005 21:06:41 GMT\"},\n            {\"Content-Length\",\"217\"},\n            {\"Content-Type\",\"text/html\"},\n            {\"Set-Cookie\",\n             \"PREF=ID=b601f16bfa32f071:CR=1:TM=1115327201:LM=1115327201:S=OX5hSB525AMjUUu7; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com\"},\n            {\"Server\",\"GWS/2.1\"},\n            {\"Location\",\n             \"http://www.google.co.uk/cxfer?c=PREF%3D:TM%3D1115327201:S%3DDS9pDJ4IHcAuZ_AS\u0026prev=/\"},\n            {\"Via\",\n             \"1.1 hatproxy01 (NetCache NetApp/5.6.2)\"}]}\nShell got {ibrowse_async_response,{1115,327256,389608},\n           \"\u003cHTML\u003e...\u003c/HTML\u003e\\r\\n\"}\nShell got {ibrowse_async_response_end,{1115,327256,389608}}\nok\n```\n\n\nAnother asynchronous `GET` request:\n\n```erlang\n24\u003e ibrowse:send_req(\"http://yaws.hyber.org/simple_ex2.yaws\", [], get, [],\n                     [{proxy_user, \"XXXXX\"},\n                      {proxy_password, \"XXXXX\"},\n                      {proxy_host, \"proxy\"},\n                      {proxy_port, 8080},\n                      {stream_to, self()}]).\n{ibrowse_req_id,{1115,327430,512314}}\n\n25\u003e flush().\nShell got {ibrowse_async_headers,{1115,327430,512314},\n           \"200\",\n           [{\"Date\",\"Thu, 05 May 2005 20:58:08 GMT\"},\n            {\"Content-Length\",\"64\"},\n            {\"Content-Type\",\"text/html;charset=\"},\n            {\"Server\",\n             \"Yaws/1.54 Yet Another Web Server\"},\n            {\"Via\",\n             \"1.1 hatproxy01 (NetCache NetApp/5.6.2)\"}]}\nShell got {ibrowse_async_response,{1115,327430,512314},\n           \"\u003chtml\u003e...\u003c/html\u003e\\n\"}\nShell got {ibrowse_async_response_end,{1115,327430,512314}}\n```\n\n\nExample of request which fails when using the async option. Here\nthe `{ibrowse_req_id, ReqId}` is not returned. Instead the error code is\nreturned.\n\n```erlang\n68\u003e ibrowse:send_req(\"http://www.earlyriser.org\", [], get, [], [{stream_to, self()}]).\n{error,conn_failed}\n```\n\n\n\n### Other Examples\n\nExample of request using both Proxy-Authorization and authorization\nby the final webserver:\n\n```erlang\n17\u003e ibrowse:send_req(\"http://www.erlang.se/lic_area/protected/patches/erl_756_otp_beam.README\",\n                     [], get, [],\n                     [{proxy_user, \"XXXXX\"},\n                      {proxy_password, \"XXXXX\"},\n                      {proxy_host, \"proxy\"},\n                      {proxy_port, 8080},\n                      {basic_auth, {\"XXXXX\", \"XXXXXX\"}}]).\n{ok,\"200\",\n    [{\"Accept-Ranges\",\"bytes\"},\n     {\"Date\",\"Thu, 05 May 2005 21:02:09 GMT\"},\n     {\"Content-Length\",\"2088\"},\n     {\"Content-Type\",\"text/plain\"},\n     {\"Server\",\"Apache/1.3.9 (Unix)\"},\n     {\"Last-Modified\",\"Tue, 03 May 2005 15:08:18 GMT\"},\n     {\"ETag\",\"\\\"1384c8-828-427793e2\\\"\"},\n     {\"Via\",\"1.1 hatproxy01 (NetCache NetApp/5.6.2)\"}],\n    \"Patch Id:\\t\\terl_756_otp_beam\\n...\"}\n```\n\n\nExample of a `TRACE` request. Very interesting! yaws.hyber.org didn't\nsupport this. Nor did www.google.com. But good old BBC supports this:\n\n```erlang\n37\u003e ibrowse:send_req(\"http://www.bbc.co.uk/\", [], trace, [],\n                         [{proxy_user, \"XXXXX\"},\n                          {proxy_password, \"XXXXX\"},\n                          {proxy_host, \"proxy\"},\n                          {proxy_port, 8080}]).\n{ok,\"200\",\n    [{\"Transfer-Encoding\",\"chunked\"},\n     {\"Date\",\"Thu, 05 May 2005 21:40:27 GMT\"},\n     {\"Content-Type\",\"message/http\"},\n     {\"Server\",\"Apache/2.0.51 (Unix)\"},\n     {\"Set-Cookie\",\n      \"BBC-UID=7452e72a...\"},\n     {\"Set-Cookie\",\n      \"BBC-UID=7452e72a...\"},\n     {\"Via\",\"1.1 hatproxy01 (NetCache NetApp/5.6.2)\"}],\n    \"TRACE / HTTP/1.1\\r\\nHost: www.bbc.co.uk\\r\\nConnection: keep-alive\\r\\nX-Forwarded-For: 172.24.28.29\\r\\nVia: 1.1 hatproxy01 (NetCache NetApp/5.6.2)\\r\\nCookie: BBC-UID=7452e...\\r\\n\\r\\n\"}\n```\n\nA `GET` using a socks5:\n\n```erlang\nibrowse:send_req(\"http://google.com\", [], get, [],\n  [{socks5_host, \"127.0.0.1\"},\n  {socks5_port, 5335}]).\n\nibrowse:send_req(\"http://google.com\", [], get, [],\n  [{socks5_host, \"127.0.0.1\"},\n  {socks5_port, 5335},\n  {socks5_user, \"user4321\"},\n  {socks5_password, \"pass7654\"}]).\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcouchdb-ibrowse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fcouchdb-ibrowse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcouchdb-ibrowse/lists"}