Skip to content

Commit

Permalink
regen documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Oct 22, 2016
1 parent 790187c commit b3814c9
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 285 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Copyright (c) 2012-2016 Benoît Chesneau.

__Version:__ 1.6.1
__Version:__ 1.6.2

# hackney

**hackney** is an HTTP client library for Erlang.

[![Build Status](https://secure.travis-ci.org/benoitc/hackney.svg?branch=master)](https://travis-ci.org/benoitc/hackney)
[![Build Status](https://travis-ci.org/benoitc/hackney.png?branch=master)](https://travis-ci.org/benoitc/hackney)
[![Hex pm](http://img.shields.io/hexpm/v/hackney.svg?style=flat)](https://hex.pm/packages/hackney)

## Main features:
Expand Down Expand Up @@ -172,6 +172,8 @@ read_body(MaxLength, Ref, Acc) when MaxLength > byte_size(Acc) ->
> Note: you can also fetch a multipart response using the functions
> `hackney:stream_multipart/1` and `hackney:skip_multipart/1`.
> Note 2: using the `with_body` option will return the body directy instead of a reference.
### Reuse a connection

By default all connections are created and closed dynamically by
Expand Down Expand Up @@ -214,15 +216,15 @@ NextReq = {NextMethod, NextPath, ReqHeaders, ReqBody}
Here we are posting a JSON payload to '/' on the friendpaste service to
create a paste. Then we close the client connection.

> If your connection supports keepalive the connection will be simply :
> If your connection supports keepalive the connection will be kept open until you close it exclusively.
### Send a body

hackney helps you send different payloads by passing different terms as
the request body:

- `{form, PropList}` : To send a form
- `{multipart, Parts}` : to send you body using the multipart API. Parts
- `{multipart, Parts}` : to send your body using the multipart API. Parts
follow this format:
- `eof`: end the multipart request
- `{file, Path}`: to stream a file
Expand Down Expand Up @@ -316,7 +318,7 @@ LoopFun(LoopFun, ClientRef).
> synchronously using the function `hackney:stop_async/1` See the
> example [test_async_once2](https://github.com/benoitc/hackney/blob/master/examples/test_async_once2.erl) for the usage.
> **Note 4**: When the option `{following_redirect, true}` is passed to
> **Note 4**: When the option `{follow_redirect, true}` is passed to
> the request, you will receive the folllowing messages on valid
> redirection:
> - `{redirect, To, Headers}`
Expand Down Expand Up @@ -508,7 +510,7 @@ $ pip install gunicorn httpbin
Running the tests:

```
$ gunicorn -b 127.0.0.1:8000 -b unix:httpbin.sock --daemon --pid httpbin.pid httpbin:appl
$ gunicorn --daemon --pid httpbin.pid httpbin:app
$ make test
$ kill `cat httpbin.pid`
```
Expand All @@ -527,6 +529,7 @@ $ kill `cat httpbin.pid`
<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_http.md" class="module">hackney_http</a></td></tr>
<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_http_connect.md" class="module">hackney_http_connect</a></td></tr>
<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_local_tcp.md" class="module">hackney_local_tcp</a></td></tr>
<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_manager.md" class="module">hackney_manager</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>
Expand All @@ -541,3 +544,4 @@ $ kill `cat httpbin.pid`
<tr><td><a href="http://github.com/benoitc/hackney/blob/master/doc/hackney_trace.md" class="module">hackney_trace</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>

11 changes: 7 additions & 4 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Copyright (c) 2012-2016 Benoît Chesneau.

__Version:__ 1.6.1
__Version:__ 1.6.2

# hackney

Expand Down Expand Up @@ -172,6 +172,8 @@ read_body(MaxLength, Ref, Acc) when MaxLength > byte_size(Acc) ->
> Note: you can also fetch a multipart response using the functions
> `hackney:stream_multipart/1` and `hackney:skip_multipart/1`.
> Note 2: using the `with_body` option will return the body directy instead of a reference.
### Reuse a connection

By default all connections are created and closed dynamically by
Expand Down Expand Up @@ -214,15 +216,15 @@ NextReq = {NextMethod, NextPath, ReqHeaders, ReqBody}
Here we are posting a JSON payload to '/' on the friendpaste service to
create a paste. Then we close the client connection.

> If your connection supports keepalive the connection will be simply :
> If your connection supports keepalive the connection will be kept open until you close it exclusively.
### Send a body

hackney helps you send different payloads by passing different terms as
the request body:

- `{form, PropList}` : To send a form
- `{multipart, Parts}` : to send you body using the multipart API. Parts
- `{multipart, Parts}` : to send your body using the multipart API. Parts
follow this format:
- `eof`: end the multipart request
- `{file, Path}`: to stream a file
Expand Down Expand Up @@ -316,7 +318,7 @@ LoopFun(LoopFun, ClientRef).
> synchronously using the function `hackney:stop_async/1` See the
> example [test_async_once2](https://github.com/benoitc/hackney/blob/master/examples/test_async_once2.erl) for the usage.
> **Note 4**: When the option `{following_redirect, true}` is passed to
> **Note 4**: When the option `{follow_redirect, true}` is passed to
> the request, you will receive the folllowing messages on valid
> redirection:
> - `{redirect, To, Headers}`
Expand Down Expand Up @@ -527,6 +529,7 @@ $ kill `cat httpbin.pid`
<tr><td><a href="hackney_headers.md" class="module">hackney_headers</a></td></tr>
<tr><td><a href="hackney_http.md" class="module">hackney_http</a></td></tr>
<tr><td><a href="hackney_http_connect.md" class="module">hackney_http_connect</a></td></tr>
<tr><td><a href="hackney_local_tcp.md" class="module">hackney_local_tcp</a></td></tr>
<tr><td><a href="hackney_manager.md" class="module">hackney_manager</a></td></tr>
<tr><td><a href="hackney_multipart.md" class="module">hackney_multipart</a></td></tr>
<tr><td><a href="hackney_pool.md" class="module">hackney_pool</a></td></tr>
Expand Down
8 changes: 4 additions & 4 deletions doc/edoc-info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{application,hackney}.
{modules,[hackney,hackney_app,hackney_bstr,hackney_connect,hackney_cookie,
hackney_date,hackney_headers,hackney_http,hackney_http_connect,
hackney_manager,hackney_multipart,hackney_pool,hackney_pool_handler,
hackney_request,hackney_response,hackney_socks5,
hackney_ssl,hackney_stream,hackney_sup,
hackney_tcp,hackney_trace,hackney_url,hackney_util]}.
hackney_local_tcp,hackney_manager,hackney_multipart,hackney_pool,
hackney_pool_handler,hackney_request,hackney_response,
hackney_socks5,hackney_ssl,hackney_stream,hackney_sup,hackney_tcp,
hackney_trace,hackney_url,hackney_util]}.
4 changes: 2 additions & 2 deletions doc/hackney.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ options to it.</td></tr><tr><td valign="top"><a href="#setopts-2">setopts/2</a><
### body/1 ###

<pre><code>
body(Ref::<a href="#type-client_ref">client_ref()</a>) -&gt; {ok, binary()} | {error, atom()}
body(Ref::<a href="#type-client_ref">client_ref()</a>) -&gt; {ok, binary()} | {error, atom()} | {error, {closed, binary()}}
</code></pre>
<br />

Expand All @@ -94,7 +94,7 @@ Return the full body sent with the response.
### body/2 ###

<pre><code>
body(Ref::<a href="#type-client_ref">client_ref()</a>, MaxLength::non_neg_integer() | infinity) -&gt; {ok, binary()} | {error, atom()}
body(Ref::<a href="#type-client_ref">client_ref()</a>, MaxLength::non_neg_integer() | infinity) -&gt; {ok, binary()} | {error, atom()} | {error, {closed, binary()}}
</code></pre>
<br />

Expand Down
8 changes: 7 additions & 1 deletion doc/hackney_connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## Function Index ##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#check_or_close-1">check_or_close/1</a></td><td></td></tr><tr><td valign="top"><a href="#close-1">close/1</a></td><td>close the client.</td></tr><tr><td valign="top"><a href="#connect-3">connect/3</a></td><td></td></tr><tr><td valign="top"><a href="#connect-4">connect/4</a></td><td></td></tr><tr><td valign="top"><a href="#connect-5">connect/5</a></td><td></td></tr><tr><td valign="top"><a href="#create_connection-4">create_connection/4</a></td><td>create a connection and return a client state.</td></tr><tr><td valign="top"><a href="#create_connection-5">create_connection/5</a></td><td></td></tr><tr><td valign="top"><a href="#is_pool-1">is_pool/1</a></td><td>get current pool pid or name used by a client if needed.</td></tr><tr><td valign="top"><a href="#maybe_connect-1">maybe_connect/1</a></td><td>connect a socket and create a client state.</td></tr><tr><td valign="top"><a href="#reconnect-4">reconnect/4</a></td><td></td></tr><tr><td valign="top"><a href="#set_sockopts-2">set_sockopts/2</a></td><td>add set sockets options in the client.</td></tr><tr><td valign="top"><a href="#ssl_opts-2">ssl_opts/2</a></td><td></td></tr></table>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#check_or_close-1">check_or_close/1</a></td><td></td></tr><tr><td valign="top"><a href="#close-1">close/1</a></td><td>close the client.</td></tr><tr><td valign="top"><a href="#connect-3">connect/3</a></td><td></td></tr><tr><td valign="top"><a href="#connect-4">connect/4</a></td><td></td></tr><tr><td valign="top"><a href="#connect-5">connect/5</a></td><td></td></tr><tr><td valign="top"><a href="#create_connection-4">create_connection/4</a></td><td>create a connection and return a client state.</td></tr><tr><td valign="top"><a href="#create_connection-5">create_connection/5</a></td><td></td></tr><tr><td valign="top"><a href="#is_pool-1">is_pool/1</a></td><td>get current pool pid or name used by a client if needed.</td></tr><tr><td valign="top"><a href="#maybe_connect-1">maybe_connect/1</a></td><td>connect a socket and create a client state.</td></tr><tr><td valign="top"><a href="#partial_chain-1">partial_chain/1</a></td><td></td></tr><tr><td valign="top"><a href="#reconnect-4">reconnect/4</a></td><td></td></tr><tr><td valign="top"><a href="#set_sockopts-2">set_sockopts/2</a></td><td>add set sockets options in the client.</td></tr><tr><td valign="top"><a href="#ssl_opts-2">ssl_opts/2</a></td><td></td></tr></table>


<a name="functions"></a>
Expand Down Expand Up @@ -78,6 +78,12 @@ get current pool pid or name used by a client if needed

connect a socket and create a client state.

<a name="partial_chain-1"></a>

### partial_chain/1 ###

`partial_chain(Certs) -> any()`

<a name="reconnect-4"></a>

### reconnect/4 ###
Expand Down
75 changes: 0 additions & 75 deletions doc/hackney_dummy_metrics.md

This file was deleted.

96 changes: 0 additions & 96 deletions doc/hackney_exometer_metrics.md

This file was deleted.

0 comments on commit b3814c9

Please sign in to comment.