Skip to content

Latest commit

 

History

History
145 lines (85 loc) · 3.71 KB

bookish_spork_request.md

File metadata and controls

145 lines (85 loc) · 3.71 KB

Module bookish_spork_request

Data Types

abstract datatype: t()

Function Index

body/1request body.
content_length/1Content-Length header value as intger.
from_transport/1
header/2Returns a particular header from request.
headers/1HTTP headers map.
is_keepalive/1tells you if the request is keepalive or not https://tools.ietf.org/html/rfc6223
method/1http verb in lower case: get, post, put, delete, options, ...
raw_headers/1HTTP raw headers.
transport/1
uri/1path with query string.
version/1http protocol version tuple.

Function Details

body/1


body(Request::t()) -> binary()

request body

content_length/1


content_length(Request::t()) -> integer()

Content-Length header value as intger

from_transport/1


from_transport(Transport::bookish_spork_transport:t()) -> t()

header/2


header(Request::t(), HeaderName::string() | binary()) -> binary() | nil

Returns a particular header from request.

headers/1


headers(Request::t()) -> map()

HTTP headers map. Header names are normalized and lowercased

is_keepalive/1


is_keepalive(Request::t()) -> boolean()

tells you if the request is keepalive or not https://tools.ietf.org/html/rfc6223

method/1


method(Request::t()) -> atom()

http verb in lower case: get, post, put, delete, options, ...

raw_headers/1


raw_headers(Request::t()) -> proplists:proplist()

HTTP raw headers. Headers order and case are preserved

transport/1

transport(X1) -> any()

uri/1


uri(Request::t()) -> binary() | nil

path with query string

version/1


version(Request::t()) -> tuple() | nil

http protocol version tuple. Most often would be {1, 1}