Skip to content

Commit

Permalink
remove travis & sync doc
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed Dec 19, 2020
1 parent 0aba89f commit 96b6d19
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 83 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ mime.types
*.plt
.rebar
*_plt
rebar3.crashdump
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ __Version:__ 1.16.0

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

[![Build Status](https://github.com/benoitc/hackney/workflows/build/badge.svg)](https://github.com/benoitc/hackney)
[![Build Status](https://github.com/benoitc/hackney/workflows/build/badge.svg)](https://github.com/benoitc/hackney/actions?query=workflow%3Abuild)
[![Hex pm](http://img.shields.io/hexpm/v/hackney.svg?style=flat)](https://hex.pm/packages/hackney)

## Main features:
Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ __Version:__ 1.16.0

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

[![Build Status](https://travis-ci.org/benoitc/hackney.png?branch=master)](https://travis-ci.org/benoitc/hackney)
[![Build Status](https://github.com/benoitc/hackney/workflows/build/badge.svg)](https://github.com/benoitc/hackney/actions?query=workflow%3Abuild)
[![Hex pm](http://img.shields.io/hexpm/v/hackney.svg?style=flat)](https://hex.pm/packages/hackney)

## Main features:
Expand Down
23 changes: 15 additions & 8 deletions doc/hackney.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fashion</li>
<li><code>{part, Name}</code>: to start sending a part without length in a streaming
fashion</li>
<li><code>{part, Name, ExtraHeader}</code>: to start sending a part without
lengthin a streaming fashion</li>
length in a streaming fashion</li>
<li><code>{part_bin, Bin}</code>: To send part of part</li>
<li><code>{part, eof}</code>: To notify the end of the part </li>
<li><code>{mp_mixed, Name, MixedBoundary}</code>: To notify we start a part with a a mixed
Expand Down Expand Up @@ -487,7 +487,7 @@ fashion
fashion

* `{part, Name, ExtraHeader}`: to start sending a part without
lengthin a streaming fashion
length in a streaming fashion

* `{part_bin, Bin}`: To send part of part

Expand Down Expand Up @@ -531,18 +531,25 @@ setopts(Ref::<a href="#type-client_ref">client_ref()</a>, Options::list()) -&gt;

set client options.
Options are:
- `async`: to fetch the response asynchronously
- `{async, once}`: to receive the response asynchronously one time.

* `async`: to fetch the response asynchronously

* `{async, once}`: to receive the response asynchronously one time.
To receive the next message use the function `hackney:stream_next/1`.
- `{stream_to, pid()}`: to set the pid where the messages of an

* `{stream_to, pid()}`: to set the pid where the messages of an
asynchronous response will be sent.
- `{follow_redirect, bool()}` : if true a redirection will be

* `{follow_redirect, bool()}` : if true a redirection will be
followed when the response is received synchronously
- `{force_redirect, bool()}` : if true a 301/302 redirection will be

* `{force_redirect, bool()}` : if true a 301/302 redirection will be
followed even on POST.
- `{max_redirect, integer()}` the maximum number of redirections that

* `{max_redirect, integer()}` the maximum number of redirections that
will be followed


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

### skip_body/1 ###
Expand Down
53 changes: 36 additions & 17 deletions doc/hackney_http.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,41 @@ you can process later with `hackney_http:execute/2` when
`{more, ...}` is returnned or `hackney_http:execute/1` in other
cases:

- `{response, http_version(), status(), http_reason(), parser()}`:
* `{response, http_version(), status(), http_reason(), parser()}`:
when the first line of a response is parsed
- `{request, http_version(), http_method(), uri(), parser()}`:

* `{request, http_version(), http_method(), uri(), parser()}`:
when the first line of a request (on servers) is parsed
- `{more, parser()}`: when the parser need more

* `{more, parser()}`: when the parser need more
data. The new data should be passed to `hackney_http:execute/2` with
the new parser() state received.
- `{header, {Name :: binary(), Value :: binary()}, parser()}`:

* `{header, {Name :: binary(), Value :: binary()}, parser()}`:
when an header has been parsed. To continue the parsing you must
call the given `parser()` with `hackney_http:execute/1`.
- `{headers_complete, parser()}` : when all headers have been parsed.

* `{headers_complete, parser()}` : when all headers have been parsed.
To continue the parsing you must call the given `parser()` state
with `hackney_http:execute/1`.
- `{more, parser(), binary()}`: on body, when

* `{more, parser(), binary()}`: on body, when
the parser need more data. The new data should be passed to
`hackney_http:execute/2` (with `parser()` ) when received. The binary at the end of the
tuple correspond to the actual buffer of the parser. It may be used
for other purpose, like start to parse a new request on pipeline
connections, for a proxy...
- `{ok, binary(), parser()}`: on body, when a chunk has been

* `{ok, binary(), parser()}`: on body, when a chunk has been
parsed. To continue the parsing you must call
`hackney_http:execute/1` with the given `parser()`.
- `{done, binary()}`: when the parsing is done. The binary

* `{done, binary()}`: when the parsing is done. The binary
given correpond to the non parsed part of the internal buffer.
- `{error, term{}}`: when an error happen

* `{error, term{}}`: when an error happen


<a name="types"></a>

## Data Types ##
Expand Down Expand Up @@ -213,14 +223,23 @@ get(Parser::<a href="#type-parser">parser()</a>, Props::atom() | [atom()]) -&gt;

retrieve a parser property.
Properties are:
- `buffer`: internal buffer of the parser (non parsed)
- `state`: the current state (on_status, on_header, on_body, done)
- `version`: HTTP version
- `content_length`: content length header if any
- `transfer_encoding`: transfer encoding header if any
- `content_type`: content type header if any
- `location`: location header if any
- `connection`: connection header if any.

* `buffer`: internal buffer of the parser (non parsed)

* `state`: the current state (on_status, on_header, on_body, done)

* `version`: HTTP version

* `content_length`: content length header if any

* `transfer_encoding`: transfer encoding header if any

* `content_type`: content type header if any

* `location`: location header if any

* `connection`: connection header if any.


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

Expand Down
45 changes: 30 additions & 15 deletions doc/hackney_multipart.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ part_result() = <a href="#type-headers">headers()</a> | eof
## Function Index ##


<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-2">decode_form/2</a></td><td>decode a multipart form.</td></tr><tr><td valign="top"><a href="#encode_form-1">encode_form/1</a></td><td>encode a list of parts a multipart form.</td></tr><tr><td valign="top"><a href="#encode_form-2">encode_form/2</a></td><td></td></tr><tr><td valign="top"><a href="#len_mp_stream-2">len_mp_stream/2</a></td><td>get the size of a mp stream.</td></tr><tr><td valign="top"><a href="#mp_data_header-2">mp_data_header/2</a></td><td>return the multipart header for a data.</td></tr><tr><td valign="top"><a href="#mp_eof-1">mp_eof/1</a></td><td>return the boundary ennding a multipart.</td></tr><tr><td valign="top"><a href="#mp_file_header-2">mp_file_header/2</a></td><td>return the multipart header for a file that will be sent later.</td></tr><tr><td valign="top"><a href="#mp_header-2">mp_header/2</a></td><td>create a generic multipart header.</td></tr><tr><td valign="top"><a href="#mp_mixed_header-2">mp_mixed_header/2</a></td><td>return the mixed multipart header.</td></tr><tr><td valign="top"><a href="#parser-1">parser/1</a></td><td>Return a multipart parser for the given boundary.</td></tr><tr><td valign="top"><a href="#part-3">part/3</a></td><td>create a part.</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-2">decode_form/2</a></td><td>decode a multipart form.</td></tr><tr><td valign="top"><a href="#encode_form-1">encode_form/1</a></td><td>encode a list of parts a multipart form.</td></tr><tr><td valign="top"><a href="#encode_form-2">encode_form/2</a></td><td></td></tr><tr><td valign="top"><a href="#len_mp_stream-2">len_mp_stream/2</a></td><td>get the size of a mp stream.</td></tr><tr><td valign="top"><a href="#mp_data_header-2">mp_data_header/2</a></td><td>return the multipart header for a data.</td></tr><tr><td valign="top"><a href="#mp_eof-1">mp_eof/1</a></td><td>return the boundary ending a multipart.</td></tr><tr><td valign="top"><a href="#mp_file_header-2">mp_file_header/2</a></td><td>return the multipart header for a file that will be sent later.</td></tr><tr><td valign="top"><a href="#mp_header-2">mp_header/2</a></td><td>create a generic multipart header.</td></tr><tr><td valign="top"><a href="#mp_mixed_header-2">mp_mixed_header/2</a></td><td>return the mixed multipart header.</td></tr><tr><td valign="top"><a href="#parser-1">parser/1</a></td><td>Return a multipart parser for the given boundary.</td></tr><tr><td valign="top"><a href="#part-3">part/3</a></td><td>create a part.</td></tr></table>


<a name="functions"></a>
Expand Down Expand Up @@ -152,16 +152,24 @@ decode a multipart form.

encode a list of parts a multipart form.
Parts can be under the form:
- `{file, Path}` : to send a file
- `{file, Path, ExtraHeaders}` : to send a file with extra headers
- `{file, Path, Name, ExtraHeaders}`: to send a file with DOM element name and extra headers
- `{mp_mixed, Name, Boundary}` to send a mixed multipart.
- `{mp_mixed_eof, Boundary}`: to signal the end of the mixed

* `{file, Path}` : to send a file

* `{file, Path, ExtraHeaders}` : to send a file with extra headers

* `{file, Path, Name, ExtraHeaders}`: to send a file with DOM element name and extra headers

* `{mp_mixed, Name, Boundary}` to send a mixed multipart.

* `{mp_mixed_eof, Boundary}`: to signal the end of the mixed
multipart boundary.
- `{Name, Data}`: to send a custom content as a part
- `{Name, Data, ExtraHeaders}`: the same as above but with extra

* `{Name, Data}`: to send a custom content as a part

* `{Name, Data, ExtraHeaders}`: the same as above but with extra
headers.


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

### encode_form/2 ###
Expand All @@ -182,15 +190,22 @@ content-length of a full multipart stream and send it as an identity
transfer-encoding instead of chunked so any server can handle it.

Calculated Parts can be under the form:
- `{file, Path}` : to send a file
- `{file, Path, ExtraHeaders}` : to send a file with extra headers
- `{file, Path, Name, ExtraHeaders}` : to send a file with DOM element name and extra headers
- `{mp_mixed, Name, Boundary}` to send a mixed multipart.

* `{file, Path}` : to send a file

* `{file, Path, ExtraHeaders}` : to send a file with extra headers

* `{file, Path, Name, ExtraHeaders}` : to send a file with DOM element name and extra headers

* `{mp_mixed, Name, Boundary}` to send a mixed multipart.
multipart boundary.
- `{Name, DataLen}`: to send a custom content as a part
- `{Name, DataLen, ExtraHeaders}`: the same as above but with extra

* `{Name, DataLen}`: to send a custom content as a part

* `{Name, DataLen, ExtraHeaders}`: the same as above but with extra
headers.


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

### mp_data_header/2 ###
Expand All @@ -208,7 +223,7 @@ return the multipart header for a data

`mp_eof(Boundary) -> any()`

return the boundary ennding a multipart
return the boundary ending a multipart

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

Expand Down
6 changes: 3 additions & 3 deletions doc/hackney_url.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ qs_opt() = noplus | upper


<pre><code>
qs_vals() = [{binary(), binary() | true}]
qs_vals() = [{binary() | atom() | list() | integer(), binary() | true}]
</code></pre>

<a name="index"></a>
Expand Down Expand Up @@ -217,7 +217,7 @@ urlencode(Bin::binary() | string(), Opts::[<a href="#type-qs_opt">qs_opt()</a>])

URL encode a string binary.
The `noplus` option disables the default behaviour of quoting space
characters, `\s`, as `+`. The `upper` option overrides the default behaviour
of writing hex numbers using lowecase letters to using uppercase letters
characters, `\s`, as `+`. The `lower` option overrides the default behaviour
of writing hex numbers using uppercase letters to using lowercase letters
instead.

2 changes: 1 addition & 1 deletion doc/overview.edoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
**hackney** is an HTTP client library for Erlang.


[![Build Status](https://travis-ci.org/benoitc/hackney.png?branch=master)](https://travis-ci.org/benoitc/hackney)
[![Build Status](https://github.com/benoitc/hackney/workflows/build/badge.svg)](https://github.com/benoitc/hackney/actions?query=workflow%3Abuild)
[![Hex pm](http://img.shields.io/hexpm/v/hackney.svg?style=flat)](https://hex.pm/packages/hackney)


Expand Down

0 comments on commit 96b6d19

Please sign in to comment.