Skip to content

Commit

Permalink
bump to 0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Nov 11, 2014
1 parent 3cc27a5 commit acd0a4f
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 31 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# NEWS

0.15.0 - 2014/11/11
-------------------

- improve hackney performance and concurrency
- fix pool handling: make sure to reuse the connections

0.14.3 - 2014/10/28
-------------------

Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

__Version:__ 0.14.3
__Version:__ 0.15.0

# hackney

Expand All @@ -27,30 +27,30 @@ Main features:
- Optional socket pool
- REST syntax: `hackney:Method(URL)` (where a method can be get, post, put, delete, ...)

Hackney use [hackney_lib](http://github.com/benoitc/hackney_lib) to
Hackney uses [hackney_lib](http://github.com/benoitc/hackney_lib) to
handle any web protocols. If you want to manipulate headers, cookies,
multipart or any other thing related to web protocols this is the place
to go.

> Note: This is a work in progress, see the
[TODO](http://github.com/benoitc/hackney/blob/master/TODO.md) for more
informations on what still need to be done.
information on what still needs to be done.

#### Useful modules are:

- [`hackney`](http://github.com/benoitc/hackney/blob/master/doc/hackney.md): main module. It contains all HTTP client functions.
- [`hackney_http`](http://github.com/benoitc/hackney/blob/master/doc/hackney_http.md): HTTP parser in pure Erlang. This parser is able
to parse HTTP responses and requests in a streaming fashion. If not set
it will be autodetect if it's a request or a response if needed.
it will be autodetected if it's a request or a response that's needed.

- [`hackney_headers`](http://github.com/benoitc/hackney/blob/master/doc/hackney_headers.md) Module to manipulate HTTP headers
- [`hackney_headers`](http://github.com/benoitc/hackney/blob/master/doc/hackney_headers.md) Module to manipulate HTTP headers.
- [`hackney_cookie`](http://github.com/benoitc/hackney/blob/master/doc/hackney_cookie.md): Module to manipulate cookies.
- [`hackney_multipart`](http://github.com/benoitc/hackney/blob/master/doc/hackney_multipart.md): Module to encode/decode multipart.
- [`hackney_url`](http://github.com/benoitc/hackney/blob/master/doc/hackney_url.md): Module to parse and create URIs.
- [`hackney_date`](http://github.com/benoitc/hackney/blob/master/doc/hackney_date.md): Module to parse HTTP dates.

Read the [NEWS](https://raw.github.com/benoitc/hackney/master/NEWS.md) file
to get last changelog.
to get the last changelog.

## Installation

Expand Down Expand Up @@ -121,7 +121,7 @@ Options = [],
Options).
```

The request method return the tuple `{ok, StatusCode, Headers, ClientRef}`
The request method returns the tuple `{ok, StatusCode, Headers, ClientRef}`
or `{error, Reason}`. A `ClientRef` is simply a reference to the current
request that you can reuse.

Expand All @@ -131,7 +131,7 @@ If you prefer the REST syntax, you can also do:
hackney:Method(URL, Headers, Payload, Options)
```

where `Method`, can be any HTTP methods in lowercase.
where `Method`, can be any HTTP method in lowercase.

### Read the body

Expand Down Expand Up @@ -162,8 +162,8 @@ read_body(MaxLength, Ref, Acc) when MaxLength > byte_size(Acc) ->

By default all connections are created and closed dynamically by
hackney but sometimes you may want to reuse the same reference for your
connections. It's especially usefull you just want to handle serially a
couple of request.
connections. It's especially useful if you just want to handle serially a
couple of requests.

> A closed connection will automatically be reconnected.
Expand Down Expand Up @@ -262,7 +262,7 @@ ok = hackney:send_body(ClientRef, ReqBody),
### Get a response asynchronously

Since the 0.6 version, hackney is able to fetch the response
asynchrnously using the `async` option:
asynchronously using the `async` option:

```erlang

Expand Down Expand Up @@ -298,7 +298,7 @@ LoopFun(LoopFun, ClientRef).
> **Note 2**: Asynchronous responses automatically checkout the socket at the end.
> **Note 3**: At any time you can go back and received your response
> **Note 3**: At any time you can go back and receive your response
> 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.
Expand Down Expand Up @@ -362,7 +362,7 @@ hackney_pool:stop_pool(PoolName).
Since the version 0.8 it is now possible to use your own Pool to
maintain the connections in hackney.

A pool handler is a module that handle the `hackney_pool_handler`
A pool handler is a module that handles the `hackney_pool_handler`
behaviour.

See for example the
Expand All @@ -378,7 +378,7 @@ retrieve the body. The maximum number of connections can be set using the

The client will follow redirects on 301, 302 & 307 if the method is
get or head. If another method is used the tuple
`{ok, maybe_redirect, Status, Headers, Client}` will be returned. It
`{ok, maybe_redirect, Status, Headers, Client}` will be returned. It will
only follow 303 redirects (see other) if the method is a POST.

Last Location is stored in the `location` property of the client state.
Expand Down
28 changes: 14 additions & 14 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

__Version:__ 0.14.3
__Version:__ 0.15.0

# hackney

Expand All @@ -27,30 +27,30 @@ Main features:
- Optional socket pool
- REST syntax: `hackney:Method(URL)` (where a method can be get, post, put, delete, ...)

Hackney use [hackney_lib](http://github.com/benoitc/hackney_lib) to
Hackney uses [hackney_lib](http://github.com/benoitc/hackney_lib) to
handle any web protocols. If you want to manipulate headers, cookies,
multipart or any other thing related to web protocols this is the place
to go.

> Note: This is a work in progress, see the
[TODO](http://github.com/benoitc/hackney/blob/master/TODO.md) for more
informations on what still need to be done.
information on what still needs to be done.

#### Useful modules are:

- [`hackney`](hackney.md): main module. It contains all HTTP client functions.
- [`hackney_http`](hackney_http.md): HTTP parser in pure Erlang. This parser is able
to parse HTTP responses and requests in a streaming fashion. If not set
it will be autodetect if it's a request or a response if needed.
it will be autodetected if it's a request or a response that's needed.

- [`hackney_headers`](hackney_headers.md) Module to manipulate HTTP headers
- [`hackney_headers`](hackney_headers.md) Module to manipulate HTTP headers.
- [`hackney_cookie`](hackney_cookie.md): Module to manipulate cookies.
- [`hackney_multipart`](hackney_multipart.md): Module to encode/decode multipart.
- [`hackney_url`](hackney_url.md): Module to parse and create URIs.
- [`hackney_date`](hackney_date.md): Module to parse HTTP dates.

Read the [NEWS](https://raw.github.com/benoitc/hackney/master/NEWS.md) file
to get last changelog.
to get the last changelog.

## Installation

Expand Down Expand Up @@ -121,7 +121,7 @@ Options = [],
Options).
```

The request method return the tuple `{ok, StatusCode, Headers, ClientRef}`
The request method returns the tuple `{ok, StatusCode, Headers, ClientRef}`
or `{error, Reason}`. A `ClientRef` is simply a reference to the current
request that you can reuse.

Expand All @@ -131,7 +131,7 @@ If you prefer the REST syntax, you can also do:
hackney:Method(URL, Headers, Payload, Options)
```

where `Method`, can be any HTTP methods in lowercase.
where `Method`, can be any HTTP method in lowercase.

### Read the body

Expand Down Expand Up @@ -162,8 +162,8 @@ read_body(MaxLength, Ref, Acc) when MaxLength > byte_size(Acc) ->

By default all connections are created and closed dynamically by
hackney but sometimes you may want to reuse the same reference for your
connections. It's especially usefull you just want to handle serially a
couple of request.
connections. It's especially useful if you just want to handle serially a
couple of requests.

> A closed connection will automatically be reconnected.
Expand Down Expand Up @@ -262,7 +262,7 @@ ok = hackney:send_body(ClientRef, ReqBody),
### Get a response asynchronously

Since the 0.6 version, hackney is able to fetch the response
asynchrnously using the `async` option:
asynchronously using the `async` option:

```erlang

Expand Down Expand Up @@ -298,7 +298,7 @@ LoopFun(LoopFun, ClientRef).
> **Note 2**: Asynchronous responses automatically checkout the socket at the end.
> **Note 3**: At any time you can go back and received your response
> **Note 3**: At any time you can go back and receive your response
> 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.
Expand Down Expand Up @@ -362,7 +362,7 @@ hackney_pool:stop_pool(PoolName).
Since the version 0.8 it is now possible to use your own Pool to
maintain the connections in hackney.

A pool handler is a module that handle the `hackney_pool_handler`
A pool handler is a module that handles the `hackney_pool_handler`
behaviour.

See for example the
Expand All @@ -378,7 +378,7 @@ retrieve the body. The maximum number of connections can be set using the

The client will follow redirects on 301, 302 & 307 if the method is
get or head. If another method is used the tuple
`{ok, maybe_redirect, Status, Headers, Client}` will be returned. It
`{ok, maybe_redirect, Status, Headers, Client}` will be returned. It will
only follow 303 redirects (see other) if the method is a POST.

Last Location is stored in the `location` property of the client state.
Expand Down
16 changes: 15 additions & 1 deletion doc/hackney_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ __Behaviours:__ [`gen_server`](gen_server.md).
## Function Index ##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#async_response_pid-1">async_response_pid/1</a></td><td></td></tr><tr><td valign="top"><a href="#cancel_request-1">cancel_request/1</a></td><td></td></tr><tr><td valign="top"><a href="#close_request-1">close_request/1</a></td><td></td></tr><tr><td valign="top"><a href="#code_change-3">code_change/3</a></td><td></td></tr><tr><td valign="top"><a href="#controlling_process-2">controlling_process/2</a></td><td></td></tr><tr><td valign="top"><a href="#get_state-1">get_state/1</a></td><td></td></tr><tr><td valign="top"><a href="#get_state-2">get_state/2</a></td><td></td></tr><tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td></td></tr><tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td></td></tr><tr><td valign="top"><a href="#handle_error-1">handle_error/1</a></td><td></td></tr><tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td></td></tr><tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr><tr><td valign="top"><a href="#new_request-1">new_request/1</a></td><td></td></tr><tr><td valign="top"><a href="#start_async_response-1">start_async_response/1</a></td><td></td></tr><tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td></td></tr><tr><td valign="top"><a href="#stop_async_response-1">stop_async_response/1</a></td><td></td></tr><tr><td valign="top"><a href="#take_control-2">take_control/2</a></td><td></td></tr><tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td></td></tr><tr><td valign="top"><a href="#update_state-1">update_state/1</a></td><td></td></tr><tr><td valign="top"><a href="#update_state-2">update_state/2</a></td><td></td></tr><tr><td valign="top"><a href="#with_async_response_pid-2">with_async_response_pid/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="#async_response_pid-1">async_response_pid/1</a></td><td></td></tr><tr><td valign="top"><a href="#cancel_request-1">cancel_request/1</a></td><td></td></tr><tr><td valign="top"><a href="#close_request-1">close_request/1</a></td><td></td></tr><tr><td valign="top"><a href="#code_change-3">code_change/3</a></td><td></td></tr><tr><td valign="top"><a href="#controlling_process-2">controlling_process/2</a></td><td></td></tr><tr><td valign="top"><a href="#get_state-1">get_state/1</a></td><td></td></tr><tr><td valign="top"><a href="#get_state-2">get_state/2</a></td><td></td></tr><tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td></td></tr><tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td></td></tr><tr><td valign="top"><a href="#handle_error-1">handle_error/1</a></td><td></td></tr><tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td></td></tr><tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr><tr><td valign="top"><a href="#new_request-1">new_request/1</a></td><td></td></tr><tr><td valign="top"><a href="#start_async_response-1">start_async_response/1</a></td><td></td></tr><tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td></td></tr><tr><td valign="top"><a href="#stop_async_response-1">stop_async_response/1</a></td><td></td></tr><tr><td valign="top"><a href="#store_state-1">store_state/1</a></td><td></td></tr><tr><td valign="top"><a href="#store_state-2">store_state/2</a></td><td></td></tr><tr><td valign="top"><a href="#take_control-2">take_control/2</a></td><td></td></tr><tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td></td></tr><tr><td valign="top"><a href="#update_state-1">update_state/1</a></td><td></td></tr><tr><td valign="top"><a href="#update_state-2">update_state/2</a></td><td></td></tr><tr><td valign="top"><a href="#with_async_response_pid-2">with_async_response_pid/2</a></td><td></td></tr></table>


<a name="functions"></a>
Expand Down Expand Up @@ -129,6 +129,20 @@ __Behaviours:__ [`gen_server`](gen_server.md).
`stop_async_response(Ref) -> any()`


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

### store_state/1 ###

`store_state(Client) -> any()`


<a name="store_state-2"></a>

### store_state/2 ###

`store_state(Ref, NState) -> any()`


<a name="take_control-2"></a>

### take_control/2 ###
Expand Down
2 changes: 1 addition & 1 deletion doc/overview.edoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


@copyright 2012-2014 Benoît Chesneau.
@version 0.14.3
@version 0.15.0
@title hackney - HTTP client library in Erlang

@doc
Expand Down
2 changes: 1 addition & 1 deletion src/hackney.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{application, hackney,
[
{description, "simple HTTP client"},
{vsn, "0.14.3"},
{vsn, "0.15.0"},
{registered, [hackney_pool]},
{applications, [kernel,
stdlib,
Expand Down

0 comments on commit acd0a4f

Please sign in to comment.