This module exports functions which are called
exclusively from openflax.serve to send an HTTP
response back to the user agent via the HTTP service.
| error/4 | Returns an error response. |
| moved/4 | Returns a redirection response (typically 301 or 302) to the user agent via the HTTP service. |
| send_data/3 | Sends arbitrary text or data to the HTTP service. |
| send_headers/2 | Sends an HTTP response header through the HTTP service. |
error(Http::http(), Conf::conf(), Response::response(), MasterDict::master_dict()) -> {ok, conf()}
Returns an error response. If an error-handling module is configured,
serve_error/3 will attempt to use it to generate an
error response page. Otherwise, a (very plain) stock response is offered.
moved(Http::http(), Conf::conf(), Response::response(), URI::uri()) -> {ok, conf()} | {error, Reason}
Returns a redirection response (typically 301 or 302) to the user agent via the HTTP service.
send_data(Http::http(), Conf::conf(), Data::string()) -> ok | {error, Reason}
Sends arbitrary text or data to the HTTP service. Sends nothing if the Request-Method was HEAD.
send_headers(Http::http(), Conf::conf()) -> ok | {error, Reason}
Sends an HTTP response header through the HTTP service. Note that after doing this, you should not send any body if the Request-Method is HEAD.