0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00
Small, fast, modern HTTP server for Erlang/OTP.
Find a file
Loïc Hoguin 0c37925642 Add request body reading options
The options were added to allow developers to fix timeout
issues when reading large bodies. It is also a cleaner and
easier to extend interface.

This commit deprecates the functions init_stream, stream_body
and skip_body which are no longer needed. They will be removed
in 1.0.

The body function can now take an additional argument that is a
list of options. The body_qs, part and part_body functions can
too and simply pass this argument down to the body call.

There are options for disabling the automatic continue reply,
setting a maximum length to be returned (soft limit), setting
the read length and read timeout, and setting the transfer and
content decode functions.

The return value of the body and body_qs have changed slightly.
The body function now works similarly to the part_body function,
in that it returns either an ok or a more tuple depending on
whether there is additional data to be read. The body_qs function
can return a badlength tuple if the body is too big. The default
size has been increased from 16KB to 64KB.

The default read length and timeout have been tweaked and vary
depending on the function called.

The body function will now adequately process chunked bodies,
which means that the body_qs function will too. But this means
that the behavior has changed slightly and your code should be
tested properly when updating your code.

The body and body_qs still accept a length as first argument
for compatibility purpose with older code. Note that this form
is deprecated and will be removed in 1.0. The part and part_body
function, being new and never having been in a release yet, have
this form completely removed in this commit.

Again, while most code should work as-is, you should make sure
that it actually does before pushing this to production.
2014-06-02 23:09:43 +02:00
examples Use current host as base to Websocket Example URL 2014-04-27 09:54:24 +12:00
guide Add request body reading options 2014-06-02 23:09:43 +02:00
manual Add request body reading options 2014-06-02 23:09:43 +02:00
src Add request body reading options 2014-06-02 23:09:43 +02:00
test Add request body reading options 2014-06-02 23:09:43 +02:00
.gitignore Cleanup .gitignore 2014-02-19 20:19:03 +01:00
all.sh Enable Autobahn Test Suite by default 2014-04-20 22:20:54 +02:00
AUTHORS Update AUTHORS 2013-11-14 16:49:25 +01:00
CHANGELOG.md Update CHANGELOG 2013-11-14 16:48:12 +01:00
CONTRIBUTING.md Add note about SSL tests requiring R16B01 2013-08-31 10:24:11 +02:00
erlang.mk Update erlang.mk 2014-03-24 14:06:11 +01:00
LICENSE Update copyright years 2014-02-06 19:57:23 +01:00
Makefile Make loop handlers work with SPDY 2014-04-26 13:46:55 +02:00
README.md Kato.im added to the list of sponsors 2014-04-14 12:09:56 +02:00
rebar.config Update cowlib to 0.6.1 2014-03-27 11:39:09 +01:00
ROADMAP.md Update ROADMAP 2013-11-14 15:34:16 +01:00

Cowboy

Cowboy is a small, fast and modular HTTP server written in Erlang.

Goals

Cowboy aims to provide a complete HTTP stack in a small code base. It is optimized for low latency and low memory usage, in part because it uses binary strings.

Cowboy provides routing capabilities, selectively dispatching requests to handlers written in Erlang.

Because it uses Ranch for managing connections, Cowboy can easily be embedded in any other application.

No parameterized module. No process dictionary. Clean Erlang code.

Sponsors

The SPDY implementation was sponsored by LeoFS Cloud Storage.

The project is currently sponsored by Kato.im.

Getting Started

Support