1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-09-11 21:30:45 +03:00

Improve User Manual

This commit is contained in:
bel
2014-04-11 21:39:14 +02:00
parent 040946da87
commit 93065f0278

View File

@@ -394,6 +394,7 @@ insert the content of a variable by enclosing the Lua variable name in
`<?= ?>` blocks, similar to PHP.
For example, to print the current weekday name and the URI of the current
page, one can write:
<p>
<span>Today is:</span>
<? mg.write(os.date("%A")) ?>
@@ -435,6 +436,7 @@ in Lua. Examples are given in
Civetweb exports the following functions to Lua:
mg (table):
mg.read() -- reads a chunk from POST data, returns it as a string
mg.write(str) -- writes string to the client
mg.include(path) -- sources another Lua file
@@ -466,6 +468,7 @@ mg (table):
.remote_user -- user name if authenticated, nil otherwise
connect (function):
-- Connect to the remote TCP server. This function is an implementation
-- of simple socket interface. It returns a socket object with three
-- methods: send, recv, close, which are synchronous (blocking).