# HG changeset patch # User jbe # Date 1435070856 -7200 # Node ID 828e2bca2e1695a71290f636c2c89f9ccfa118b1 # Parent d544e8379691e1f8d5d29853dcc25b9016e06902 Fixes in reference documentation diff -r d544e8379691 -r 828e2bca2e16 reference.txt --- a/reference.txt Tue Jun 23 14:47:51 2015 +0200 +++ b/reference.txt Tue Jun 23 16:47:36 2015 +0200 @@ -426,10 +426,11 @@ ----------- The HTTP module exports the function moonbridge_http.generate_handler(callback) -that converts an HTTP handler to a "connect" handler. See file "example.lua" -for an example of invocation. A table with options may be passed either as a -second argument, or as a first argument preceeding the callback function -(whichever is more convenient). +that converts an HTTP handler to a "connect" handler. See file "helloworld.lua" +for a simple example or "example_application.lua" for a more complex example of +invocation. A table with options may be passed either as a second argument, or +as a first argument preceeding the callback function (whichever is more +convenient). The following options are supported: @@ -500,9 +501,11 @@ ### request:finish() -Finishes and flushes a HTTP response. May be called multiple times. An -HTTP status, all headers, and the response body (if applicable) must have been -previously sent. After calling this method, no further data may be written. +Finishes and flushes a HTTP response. An HTTP status, all headers, and the +response body (if applicable) must have been previously sent. May be called +multiple times (performs no operation if called on a finished request handle). +Gets automatically invoked when the callback handler returns. After calling +this method explicitly, no further data may be written. ### request:finish_headers() @@ -545,8 +548,8 @@ ### request.headers A table that maps (case-insensitively) a HTTP header field name to a sequence -of values. One entry is created for every occurrence of a header line with the -given field name). +of values. For each occurrence of the respective header line, a string entry is +created in that sequence. Non-existent headers are mapped to an empty table. ### request.headers_csv_string @@ -559,8 +562,8 @@ ### request.headers_csv_table A table that maps (case-insensitively) a HTTP header field name to a sequence -of values. One entry is created for every comma separated value of each header -with the given field name. +of values. One entry is created in that sequence for every comma separated +value of each header with the given field name. ### request.headers_flags @@ -607,6 +610,9 @@ "file_name" and "content_type". If there are several POST values with the given field name, then the first value/file is used. +Note: May be implemented through metamethods, but does support iteration +through pairs(...). + ### request.post_metadata_list @@ -614,6 +620,9 @@ to a sequence with their corresponding POST metadata tables. Needed if multiple files are uploaded with the same field name. +Note: May be implemented through metamethods, but does support iteration +through pairs(...). + ### request.post_params @@ -724,7 +733,4 @@ Start streaming of request body immediately. On EOF the function returns and the callback function is *not* called with nil as argument. -Note that request:consume_input() needs to be called to enforce streaming to -finish. -