Module watts_http_util

Function Index

cookie_name/0return the name of the cookie.
create_cookie_opts/1generate the options list for the cookie.
local_port/0*return the string for the current port setting.
local_protocol/0*return the protocol to use, either https or http.
perform_cookie_action/4either update or delete a cookie.
redirect_to/2create a redirection for cowboy to the given url.
relative_path/1create a relative path starting from main path (for web).
return_http/1*helper function to return the protocol.
return_port/2*helper function to decide if the port needs to be written.
whole_url/1convert an absolute path into the url to that path.

Function Details

cookie_name/0

cookie_name() -> binary()

return the name of the cookie.

create_cookie_opts/1

create_cookie_opts(MaxAge::integer()) -> [tuple()]

generate the options list for the cookie

local_port/0 *

local_port() -> PortText::binary()

return the string for the current port setting

local_protocol/0 *

local_protocol() -> ProtocolText::binary()

return the protocol to use, either https or http.

perform_cookie_action/4

perform_cookie_action(Action::clear | update, MaxAge::integer(), CookieData::deleted | binary(), Req::cowboy_req:req()) -> {ok, cowboy_req:req()}

either update or delete a cookie. the cookie will either be updated with a new lifetime or will be deleted by setting the time to timestamp 0.

redirect_to/2

redirect_to(Url::binary(), Req::cowboy_req:req()) -> cowboy_req:req()

create a redirection for cowboy to the given url.

relative_path/1

relative_path(Append::list()) -> WholePath::binary()

create a relative path starting from main path (for web).

return_http/1 *

return_http(UseSSL::boolean()) -> binary()

helper function to return the protocol

return_port/2 *

return_port(PortNumber::pos_integer(), UsingSSL::boolean()) -> PortText::binary()

helper function to decide if the port needs to be written.

whole_url/1

whole_url(AbsPath::string() | binary()) -> binary()

convert an absolute path into the url to that path


Generated by EDoc