Skip to content

Commit

Permalink
bump to 0.40
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Oct 26, 2012
1 parent a1f7046 commit 64329fb
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 14 deletions.
14 changes: 14 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# NEWS

0.4.0 - 2012/10/26
------------------

- Allows to stream a multipart request
- Add `insecure` option to connect via ssl without verifying an SSL
certificate
- Handle empty headers values
- Add `force_redirect` option
- Add expm support
- Fix body streaming
- Fix SSL handling
- Fix hackney:request/3 (no more loop)


0.3.0 - 2012/09/26
------------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Copyright (c) 2012 Benoît Chesneau.

__Version:__ 0.3
__Version:__ 0.4

# hackney

Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Copyright (c) 2012 Benoît Chesneau.

__Version:__ 0.3
__Version:__ 0.4

# hackney

Expand Down
56 changes: 53 additions & 3 deletions doc/hackney.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,22 @@


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#body-1">body/1</a></td><td>Return the full body sent with the response.</td></tr><tr><td valign="top"><a href="#body-2">body/2</a></td><td>Return the full body sent with the response as long as the body
length doesn't go over MaxLength.</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-1">connect/1</a></td><td>connect a socket and create a client state.</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="#pool-1">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="#request-1">request/1</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-2">request/2</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-3">request/3</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-4">request/4</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-5">request/5</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#send_request-2">send_request/2</a></td><td>send a request using the current client state.</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="#skip_body-1">skip_body/1</a></td><td>skip the full body.</td></tr><tr><td valign="top"><a href="#start-0">start/0</a></td><td>Start the couchbeam process.</td></tr><tr><td valign="top"><a href="#start_pool-2">start_pool/2</a></td><td>start a pool.</td></tr><tr><td valign="top"><a href="#start_response-1">start_response/1</a></td><td>start a response.</td></tr><tr><td valign="top"><a href="#stop-0">stop/0</a></td><td>Stop the couchbeam process.</td></tr><tr><td valign="top"><a href="#stop_pool-1">stop_pool/1</a></td><td>stop a pool.</td></tr><tr><td valign="top"><a href="#stream_body-1">stream_body/1</a></td><td>Stream the response body.</td></tr><tr><td valign="top"><a href="#stream_request_body-2">stream_request_body/2</a></td><td>stream the request body.</td></tr></table>
length doesn't go over MaxLength.</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-1">connect/1</a></td><td>connect a socket and create a client state.</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="#end_stream_request_body-1">end_stream_request_body/1</a></td><td>end streaming the request body.</td></tr><tr><td valign="top"><a href="#pool-1">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="#request-1">request/1</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-2">request/2</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-3">request/3</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-4">request/4</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#request-5">request/5</a></td><td>make a request.</td></tr><tr><td valign="top"><a href="#send_request-2">send_request/2</a></td><td>send a request using the current client state.</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="#skip_body-1">skip_body/1</a></td><td>skip the full body.</td></tr><tr><td valign="top"><a href="#start-0">start/0</a></td><td>Start the couchbeam process.</td></tr><tr><td valign="top"><a href="#start_pool-2">start_pool/2</a></td><td>start a pool.</td></tr><tr><td valign="top"><a href="#start_response-1">start_response/1</a></td><td>start a response.</td></tr><tr><td valign="top"><a href="#stop-0">stop/0</a></td><td>Stop the couchbeam process.</td></tr><tr><td valign="top"><a href="#stop_pool-1">stop_pool/1</a></td><td>stop a pool.</td></tr><tr><td valign="top"><a href="#stream_body-1">stream_body/1</a></td><td>Stream the response body.</td></tr><tr><td valign="top"><a href="#stream_multipart_request-2">stream_multipart_request/2</a></td><td>stream a multipart request until eof
Possible value are :
<ul>
<li><code>eof</code>: end the multipart request</li>
<li><code>{Id, {File, FileName}}</code>: to stream a file</li>
<li><code>{data, {start, Id, DileName, ContentType}}</code>: to start to stream
arbitrary binary content</li>
<li><code>{data, Bin}`: send a binary. Use it only after emitting a
**start**</li>
<li>`{data, eof}`: stop sending an arbitary content. It doesn</code>t stop
the multipart request</li>
<li><code>{Id, {file, Filename, Content}</code>: send a full content as a
boundary</li>
<li><code>{Id, Value}</code>: send an arbitrary value as a boundary. Filename and
Id are identique</li>
</ul></td></tr><tr><td valign="top"><a href="#stream_request_body-2">stream_request_body/2</a></td><td>stream the request body.</td></tr></table>


<a name="functions"></a>
Expand Down Expand Up @@ -65,7 +80,14 @@ connect a socket and create a client state.<a name="connect-3"></a>

`connect(Transport, Host, Port, Client) -> any()`

<a name="pool-1"></a>
<a name="end_stream_request_body-1"></a>

###end_stream_request_body/1##


`end_stream_request_body(Client) -> any()`

end streaming the request body.<a name="pool-1"></a>

###pool/1##

Expand Down Expand Up @@ -260,7 +282,35 @@ stop a pool<a name="stream_body-1"></a>

`stream_body(Client) -> any()`

Stream the response body.<a name="stream_request_body-2"></a>
Stream the response body.<a name="stream_multipart_request-2"></a>

###stream_multipart_request/2##


`stream_multipart_request(Body, Client) -> any()`

stream a multipart request until eof
Possible value are :

* `eof`: end the multipart request

* `{Id, {File, FileName}}`: to stream a file

* `{data, {start, Id, DileName, ContentType}}`: to start to stream
arbitrary binary content

* `{data, Bin}`: send a binary. Use it only after emitting a
**start**</li>
<li>`{data, eof}`: stop sending an arbitary content. It doesn`t stop
the multipart request

* `{Id, {file, Filename, Content}`: send a full content as a
boundary

* `{Id, Value}`: send an arbitrary value as a boundary. Filename and
Id are identique

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

###stream_request_body/2##

Expand Down
17 changes: 15 additions & 2 deletions doc/hackney_multipart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ module to encode/decode forms.
##Function Index##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#decode_form-1">decode_form/1</a></td><td></td></tr><tr><td valign="top"><a href="#encode_form-1">encode_form/1</a></td><td>encode a list of properties in a form.</td></tr></table>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#boundary-0">boundary/0</a></td><td></td></tr><tr><td valign="top"><a href="#decode_form-1">decode_form/1</a></td><td></td></tr><tr><td valign="top"><a href="#encode_form-1">encode_form/1</a></td><td>encode a list of properties in a form.</td></tr><tr><td valign="top"><a href="#stream-2">stream/2</a></td><td></td></tr></table>


<a name="functions"></a>

##Function Details##

<a name="boundary-0"></a>

###boundary/0##


`boundary() -> any()`

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

###decode_form/1##
Expand All @@ -34,4 +41,10 @@ module to encode/decode forms.

`encode_form(KVs) -> any()`

encode a list of properties in a form.
encode a list of properties in a form.<a name="stream-2"></a>

###stream/2##


`stream(X1, Client) -> any()`

9 changes: 8 additions & 1 deletion doc/hackney_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@
##Function Index##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#perform-2">perform/2</a></td><td></td></tr><tr><td valign="top"><a href="#send-2">send/2</a></td><td></td></tr><tr><td valign="top"><a href="#send_chunk-2">send_chunk/2</a></td><td></td></tr><tr><td valign="top"><a href="#sendfile-2">sendfile/2</a></td><td></td></tr><tr><td valign="top"><a href="#stream_body-2">stream_body/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="#end_stream_body-1">end_stream_body/1</a></td><td></td></tr><tr><td valign="top"><a href="#perform-2">perform/2</a></td><td></td></tr><tr><td valign="top"><a href="#send-2">send/2</a></td><td></td></tr><tr><td valign="top"><a href="#send_chunk-2">send_chunk/2</a></td><td></td></tr><tr><td valign="top"><a href="#sendfile-2">sendfile/2</a></td><td></td></tr><tr><td valign="top"><a href="#stream_body-2">stream_body/2</a></td><td></td></tr></table>


<a name="functions"></a>

##Function Details##

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

###end_stream_body/1##


`end_stream_body(Client) -> any()`

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

###perform/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 Benoît Chesneau.
@version 0.3
@version 0.4
@title hackney - simple HTTP client in Erlang

@doc
Expand Down
4 changes: 2 additions & 2 deletions package.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Expm.Package.new(name: "hackney", description: "Simple HTTP client in Erlang",
version: "0.3.2", keywords: ["http","client","binary"],
version: "0.4.0", keywords: ["http","client","binary"],
dependencies: ["mimetypes"],
licenses: [[name: "Apache License, Version 2.0", file: "LICENSE"]],
contributors: [[name: "Adam Rutkowski",
Expand All @@ -22,5 +22,5 @@ Expm.Package.new(name: "hackney", description: "Simple HTTP client in Erlang",
]],
maintainers: [[name: "Benoit Chesneau",
email: "[email protected]"]],
repositories: [[github: "benoitc/hackney", tag: "0.3.2"]])
repositories: [[github: "benoitc/hackney", tag: "0.4.0"]])

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.3.2"},
{vsn, "0.4.0"},
{registered, [hackney_pool]},
{applications, [kernel, stdlib, crypto, public_key, ssl]},
{mod, { hackney_app, nil}},
Expand Down
4 changes: 2 additions & 2 deletions src/hackney.erl
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ end_stream_request_body(Client) ->
%% **start**</li>
%% <li>`{data, eof}`: stop sending an arbitary content. It doesn't stop
%% the multipart request</li>
%% <li>`{Id, {file, Filename, Content}`: send a full content as a
%% <li>`{Id, {file, Filename, Content}': send a full content as a
%% boundary</li>
%% <li>`{Id, Value}: send an arbitrary value as a boundary. Filename and
%% <li>`{Id, Value}': send an arbitrary value as a boundary. Filename and
%% Id are identique</li>
%% </ul>
stream_multipart_request(Body, Client) ->
Expand Down

0 comments on commit 64329fb

Please sign in to comment.