Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

document options

  • Loading branch information...
commit 5a47314648496db736679874c243674596dba1b8 1 parent f368fea
@benoitc authored
Showing with 102 additions and 16 deletions.
  1. +1 −1  Makefile
  2. +15 −15 README.md
  3. +48 −0 doc/hackney.md
  4. +38 −0 src/hackney.erl
View
2  Makefile
@@ -4,7 +4,7 @@ all: build
dev: devbuild
-doc: devclean dev
+doc: dev
$(REBAR) -C rebar_dev.config doc
clean:
View
30 README.md
@@ -240,19 +240,19 @@ $ make devclean ; # clean all files</pre>
<table width="100%" border="0" summary="list of modules">
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney.md" class="module">hackney</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_app.md" class="module">hackney_app</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_deps.md" class="module">hackney_deps</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_form.md" class="module">hackney_form</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_headers.md" class="module">hackney_headers</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_multipart.md" class="module">hackney_multipart</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_pool.md" class="module">hackney_pool</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_request.md" class="module">hackney_request</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_response.md" class="module">hackney_response</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_ssl_transport.md" class="module">hackney_ssl_transport</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_sup.md" class="module">hackney_sup</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_tcp_transport.md" class="module">hackney_tcp_transport</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_transform.md" class="module">hackney_transform</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_url.md" class="module">hackney_url</a></td></tr>
-<tr><td><a href="http://github.com/benoitc/hackney/blob/0.3.2/doc/hackney_util.md" class="module">hackney_util</a></td></tr></table>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney.md" class="module">hackney</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_app.md" class="module">hackney_app</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_deps.md" class="module">hackney_deps</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_form.md" class="module">hackney_form</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_headers.md" class="module">hackney_headers</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_multipart.md" class="module">hackney_multipart</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_pool.md" class="module">hackney_pool</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_request.md" class="module">hackney_request</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_response.md" class="module">hackney_response</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_ssl_transport.md" class="module">hackney_ssl_transport</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_sup.md" class="module">hackney_sup</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_tcp_transport.md" class="module">hackney_tcp_transport</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_transform.md" class="module">hackney_transform</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_url.md" class="module">hackney_url</a></td></tr>
+<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_util.md" class="module">hackney_util</a></td></tr></table>
View
48 doc/hackney.md
@@ -142,6 +142,54 @@ Args:
+*
+_Options:_
+[{connect_options, connect_options(),
+{ssl_options, ssl_options()},
+hackney_options()}]
+
+
+* connect_options(): The default connect_options are
+`[binary, {active, false}, {packet, raw}])` . Vor valid options
+see the gen_tcp options.
+
+
+* ssl_options(): See the ssl options from the ssl
+module.
+
+
+* Others options are:
+
+* {follow_redirect, boolean}: false by default, follow a
+redirection
+
+* {max_redirect, integer}: 5 by default, the maximum of
+redirection for a request
+
+* {force_redirect, boolean}: false by default, to force the
+redirection even on POST
+
+* {proxy, proxy_options()}: to connect via a proxy.
+
+* insecure: to perform "insecure" SSL connections and
+transfers without checking the certificate
+
+
+
+
+
+* proxy_options()* options to connect by a proxy:
+
+* binary(): url to use for the proxy. Used for basic HTTP
+proxy
+
+* {Host::binary(), Port::binary}: Host and port to connect,
+for HTTP proxy
+
+
+
+
+
<a name="send_request-2"></a>
###send_request/2##
View
38 src/hackney.erl
@@ -138,6 +138,44 @@ request(Method, URL, Headers, Body) ->
%% <li>Bin: binary or iolist</li>
%% </ul>
%% </li>
+%% <li><em>Options:</em>
+%% [{connect_options, connect_options(),
+%% {ssl_options, ssl_options()},
+%% hackney_options()}]
+%%
+%% <ul>
+%% <li>connect_options(): The default connect_options are
+%% `[binary, {active, false}, {packet, raw}])' . Vor valid options
+%% see the gen_tcp options.</li>
+%%
+%% <li>ssl_options(): See the ssl options from the ssl
+%% module.</li>
+%%
+%% <li>Others options are:
+%% <ul>
+%% <li>{follow_redirect, boolean}: false by default, follow a
+%% redirection</li>
+%% <li>{max_redirect, integer}: 5 by default, the maximum of
+%% redirection for a request</li>
+%% <li>{force_redirect, boolean}: false by default, to force the
+%% redirection even on POST</li>
+%% <li>{proxy, proxy_options()}: to connect via a proxy.</li>
+%% <li>insecure: to perform "insecure" SSL connections and
+%% transfers without checking the certificate</li>
+%% </ul>
+%%
+%% </li>
+%%
+%% <li>proxy_options()* options to connect by a proxy:
+%% <ul>
+%% <li>binary(): url to use for the proxy. Used for basic HTTP
+%% proxy</li>
+%% <li>{Host::binary(), Port::binary}: Host and port to connect,
+%% for HTTP proxy</li>
+%% </ul>
+%% </li>
+%% </ul>
+%% </li>
%% </ul>
-spec request(term(), binary(), list(), term(), list())
-> {ok, integer(), list(), #client{}} | {error, term()}.
Please sign in to comment.
Something went wrong with that request. Please try again.