From 528507c7decb2bf2fcbb55a47256011c2ce4bd4b Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 8 Nov 2011 00:51:49 +0100 Subject: Add multipart support --- include/http.hrl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/http.hrl b/include/http.hrl index 7691966..3b4e938 100644 --- a/include/http.hrl +++ b/include/http.hrl @@ -37,6 +37,13 @@ -type http_cookies() :: list({binary(), binary()}). -type http_status() :: non_neg_integer() | binary(). +%% @todo Improve this type. +-type multipart_data() :: + {headers, http_headers()} | + {data, binary()} | + end_of_part | + eof. + -record(http_req, { %% Transport. socket = undefined :: undefined | inet:socket(), @@ -62,7 +69,8 @@ cookies = undefined :: undefined | http_cookies(), %% Request body. - body_state = waiting :: waiting | done, + body_state = waiting :: waiting | done | + {multipart, non_neg_integer(), fun()}, buffer = <<>> :: binary(), %% Response. -- cgit v1.2.3