Module elli_request

Data Types

http_range()


  http_range() = {First::non_neg_integer(), Last::non_neg_integer()} | {offset, Offset::non_neg_integer()} | {suffix, Length::pos_integer()}
  

Function Index

async_send_chunk/2Send a chunk asynchronously.
body/1Return the body.
body_qs/1Parse application/x-www-form-urlencoded body into a proplist.
chunk_ref/1Return a reference that can be used to send chunks to the client.
close_chunk/1Explicitly close the chunked connection.
get_arg/2Equivalent to get_arg(Key, Req, undefined).
get_arg/3Equivalent to proplists:get_value(Key, Args, Default).
get_arg_decoded/2Equivalent to get_arg_decoded(Key, Req, undefined).
get_arg_decoded/3
get_args/1Return a proplist of keys and values of the original query string.
get_args_decoded/1
get_header/2Equivalent to proplists:get_value(Key, Headers).
get_header/3Equivalent to proplists:get_value(Key, Headers, Default).
get_range/1Parse the Range header from the request.
headers/1Return the headers.
host/1Return the host.
is_request/1
method/1Return the method.
path/1Return path split into binary parts.
peer/1
port/1Return the port.
post_arg/2Equivalent to post_arg(Key, Req, undefined).
post_arg/3
post_arg_decoded/2Equivalent to post_arg_decoded(Key, Req, undefined).
post_arg_decoded/3
post_args/1
post_args_decoded/1
query_str/1Calculate the query string associated with a given Request as a binary.
raw_path/1Return the raw_path, i.e.
scheme/1Return the scheme.
send_chunk/2Send a chunk synchronously.
to_proplist/1Serialize the Request record to a proplist.
uri_decode/1

Function Details

async_send_chunk/2

async_send_chunk(Ref, Data) -> any()

Send a chunk asynchronously.

body/1

body(Req) -> any()

Return the body.

body_qs/1

body_qs(Req) -> any()

Parse application/x-www-form-urlencoded body into a proplist.

chunk_ref/1

chunk_ref(Req) -> any()

Return a reference that can be used to send chunks to the client. If the protocol does not support it, return {error, not_supported}.

close_chunk/1

close_chunk(Ref) -> any()

Equivalent to send_chunk(Ref, close).

Explicitly close the chunked connection. Return {error, closed} if the client already closed the connection.

get_arg/2

get_arg(Key, Req) -> any()

Equivalent to get_arg(Key, Req, undefined).

get_arg/3

get_arg(Key, Req, Default) -> any()

Equivalent to proplists:get_value(Key, Args, Default).

get_arg_decoded/2

get_arg_decoded(Key, Req) -> any()

Equivalent to get_arg_decoded(Key, Req, undefined).

get_arg_decoded/3

get_arg_decoded(Key, Req, Default) -> any()

get_args/1


  get_args(Req::elli:req()) -> QueryArgs::proplists:proplist()
  

Return a proplist of keys and values of the original query string. Both keys and values in the returned proplists will be binaries or the atom true in case no value was supplied for the query value.

get_args_decoded/1

get_args_decoded(Req) -> any()

get_header/2

get_header(Key, Req) -> any()

Equivalent to proplists:get_value(Key, Headers).

get_header/3

get_header(Key, Req, Default) -> any()

Equivalent to proplists:get_value(Key, Headers, Default).

get_range/1


  get_range(Req::elli:req()) -> [http_range()] | parse_error
  

Parse the Range header from the request. The result is either a byte_range_set() or the atom parse_error. Use elli_util:normalize_range/2 to get a validated, normalized range.

headers/1

headers(Req) -> any()

Return the headers.

host/1

host(Req) -> any()

Return the host.

is_request/1

is_request(Req) -> any()

method/1

method(Req) -> any()

Return the method.

path/1

path(Req) -> any()

Return path split into binary parts.

peer/1

peer(Req) -> any()

port/1

port(Req) -> any()

Return the port.

post_arg/2

post_arg(Key, Req) -> any()

Equivalent to post_arg(Key, Req, undefined).

post_arg/3

post_arg(Key, Req, Default) -> any()

post_arg_decoded/2

post_arg_decoded(Key, Req) -> any()

Equivalent to post_arg_decoded(Key, Req, undefined).

post_arg_decoded/3

post_arg_decoded(Key, Req, Default) -> any()

post_args/1

post_args(Req) -> any()

post_args_decoded/1

post_args_decoded(Req) -> any()

query_str/1


  query_str(Req::elli:req()) -> QueryStr::binary()
  

Calculate the query string associated with a given Request as a binary.

raw_path/1

raw_path(Req) -> any()

Return the raw_path, i.e. not split or parsed for query params.

scheme/1

scheme(Req) -> any()

Return the scheme.

send_chunk/2

send_chunk(Ref, Data) -> any()

Send a chunk synchronously. If the referenced process is dead, return early with {error, closed}, instead of timing out.

to_proplist/1

to_proplist(Req) -> any()

Serialize the Request record to a proplist. Useful for logging.

uri_decode/1

uri_decode(Bin) -> any()