Copyright © 2007 Mochi Media, Inc.
Authors: Bob Ippolito (bob@mochimedia.com).
field() = socket | method | raw_path | version | headers | peer | path
abstract datatype: headers()
A mochiweb_headers structure.
iodata() = binary() | iolist()
ioheaders() = headers() | [{key(), value()}]
iolist() = [iolist() | binary() | char()]
key() = atom() | string() | binary()
abstract datatype: response()
A mochiweb_response parameterized module instance.
value() = atom() | string() | binary() | integer()
cleanup/0 | Clean up any junk in the process dictionary, required before continuing a Keep-Alive request. |
dump/0 | Dump the internal representation to a "human readable" set of terms for debugging/inspection purposes. |
get/1 | Return the internal representation of the given field. |
get_cookie_value/1 | Get the value of the given cookie. |
get_header_value/1 | Get the value of a given request header. |
new/5 | |
not_found/0 | respond({404, [{"Content-Type", "text/plain"}], "Not found."}). |
ok/1 | respond({200, [{"Content-Type", ContentType} | Headers], Body}). |
parse_cookie/0 | Parse the cookie header. |
parse_post/0 | Parse an application/x-www-form-urlencoded form POST. |
parse_qs/0 | Parse the query string of the URL. |
recv/1 | Receive Length bytes from the client as a binary, with the default idle timeout. |
recv/2 | Receive Length bytes from the client as a binary, with the given Timeout in msec. |
recv_body/0 | Receive the body of the HTTP request (defined by Content-Length), only suitable for bodies that are not larger than the default maximum (1 MB). |
respond/1 | Start the HTTP response with start_response, and send Body to the client (if the get(method) /= 'HEAD'). |
send/1 | Send data over the socket. |
serve_file/2 | Serve a file relative to DocRoot. |
should_close/0 | Return true if the connection must be closed. |
start_raw_response/1 | Start the HTTP response by sending the Code HTTP response and ResponseHeaders. |
start_response/1 | Start the HTTP response by sending the Code HTTP response and ResponseHeaders. |
cleanup() -> ok
Clean up any junk in the process dictionary, required before continuing a Keep-Alive request.
dump() -> {mochiweb_request, [{atom(), term()}]}
Dump the internal representation to a "human readable" set of terms for debugging/inspection purposes.
get(X1::field()) -> term()
Return the internal representation of the given field.
get_cookie_value(Key::string) -> string() | undefined
Get the value of the given cookie.
get_header_value(K) -> undefined | Value
Get the value of a given request header.
new() -> term()
not_found() -> response()
respond({404, [{"Content-Type", "text/plain"}], "Not found."}).
ok(X1::{value(), iodata()} | {value(), ioheaders(), iodata()}) -> response()
respond({200, [{"Content-Type", ContentType} | Headers], Body}).
parse_cookie() -> [{Key::string(), Value::string()}]
Parse the cookie header.
parse_post() -> [{Key::string(), Value::string()}]
Parse an application/x-www-form-urlencoded form POST. This has the side-effect of calling recv_body().
parse_qs() -> [{Key::string(), Value::string()}]
Parse the query string of the URL.
recv(Length::integer()) -> binary()
Receive Length bytes from the client as a binary, with the default idle timeout.
recv(Length::integer(), Timeout::integer()) -> binary()
Receive Length bytes from the client as a binary, with the given Timeout in msec.
recv_body() -> binary()
Receive the body of the HTTP request (defined by Content-Length), only suitable for bodies that are not larger than the default maximum (1 MB).
respond(X1::{integer(), ioheaders(), iodata() | chunked}) -> response()
Start the HTTP response with start_response, and send Body to the client (if the get(method) /= 'HEAD'). The Content-Length header will be set by the Body length, and the server will insert header defaults.
send(Data::iodata()) -> ok
Send data over the socket.
serve_file(Path, DocRoot) -> Response
Serve a file relative to DocRoot.
should_close() -> bool()
Return true if the connection must be closed. If false, using Keep-Alive should be safe.
start_raw_response(X1::{integer(), ioheaders()}) -> response()
Start the HTTP response by sending the Code HTTP response and ResponseHeaders.
start_response(X1::{integer(), ioheaders()}) -> response()
Start the HTTP response by sending the Code HTTP response and ResponseHeaders. The server will set header defaults such as Server and Date if not present in ResponseHeaders.
Generated by EDoc, Aug 9 2007, 14:35:44.