diff options
Diffstat (limited to 'src/cowboy_http.erl')
-rw-r--r-- | src/cowboy_http.erl | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index 99536a3..32b0ca9 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -17,15 +17,40 @@ -module(cowboy_http). %% Parsing. --export([list/2, nonempty_list/2, content_type/1, +-export([list/2, nonempty_list/2, content_type/1, content_type_params/3, media_range/2, conneg/2, language_range/2, entity_tag_match/1, http_date/1, rfc1123_date/1, rfc850_date/1, asctime_date/1, - digits/1, token/2, token_ci/2, quoted_string/2]). + whitespace/2, digits/1, token/2, token_ci/2, quoted_string/2]). %% Interpretation. -export([connection_to_atom/1, urldecode/1, urldecode/2, urlencode/1, urlencode/2]). +-type method() :: 'OPTIONS' | 'GET' | 'HEAD' + | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | binary(). +-type uri() :: '*' | {absoluteURI, http | https, Host::binary(), + Port::integer() | undefined, Path::binary()} + | {scheme, Scheme::binary(), binary()} + | {abs_path, binary()} | binary(). +-type version() :: {Major::non_neg_integer(), Minor::non_neg_integer()}. +-type header() :: 'Cache-Control' | 'Connection' | 'Date' | 'Pragma' + | 'Transfer-Encoding' | 'Upgrade' | 'Via' | 'Accept' | 'Accept-Charset' + | 'Accept-Encoding' | 'Accept-Language' | 'Authorization' | 'From' | 'Host' + | 'If-Modified-Since' | 'If-Match' | 'If-None-Match' | 'If-Range' + | 'If-Unmodified-Since' | 'Max-Forwards' | 'Proxy-Authorization' | 'Range' + | 'Referer' | 'User-Agent' | 'Age' | 'Location' | 'Proxy-Authenticate' + | 'Public' | 'Retry-After' | 'Server' | 'Vary' | 'Warning' + | 'Www-Authenticate' | 'Allow' | 'Content-Base' | 'Content-Encoding' + | 'Content-Language' | 'Content-Length' | 'Content-Location' + | 'Content-Md5' | 'Content-Range' | 'Content-Type' | 'Etag' + | 'Expires' | 'Last-Modified' | 'Accept-Ranges' | 'Set-Cookie' + | 'Set-Cookie2' | 'X-Forwarded-For' | 'Cookie' | 'Keep-Alive' + | 'Proxy-Connection' | binary(). +-type headers() :: [{header(), iodata()}]. +-type status() :: non_neg_integer() | binary(). + +-export_type([method/0, uri/0, version/0, header/0, headers/0, status/0]). + -include("include/http.hrl"). -include_lib("eunit/include/eunit.hrl"). |