0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 12:40:25 +00:00

Add cowboy_http_req:set_resp_body_fun/3.

This commit is contained in:
Magnus Klaar 2011-12-28 18:00:27 +01:00
parent 612b8f21fe
commit 937a2b0326
4 changed files with 73 additions and 10 deletions

View file

@ -36,6 +36,8 @@
-type http_headers() :: list({http_header(), iodata()}).
-type http_cookies() :: list({binary(), binary()}).
-type http_status() :: non_neg_integer() | binary().
-type http_resp_body() :: iodata() | {non_neg_integer(),
fun(() -> {sent, non_neg_integer()})}.
-record(http_req, {
%% Transport.
@ -69,7 +71,7 @@
%% Response.
resp_state = waiting :: locked | waiting | chunks | done,
resp_headers = [] :: http_headers(),
resp_body = <<>> :: iodata(),
resp_body = <<>> :: http_resp_body(),
%% Functions.
urldecode :: {fun((binary(), T) -> binary()), T}