Skip to content

Commit 4f67927

Browse files
HHHartmannmarcelstoer
authored andcommitted
Fix ftpserver documentation and some formating in httpserver.md (#3322)
1 parent 1503e28 commit 4f67927

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

docs/lua-modules/ftpserver.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This implementation is by [Terry Ellison](https://github.com/TerryE), but I wish
3434
Create the FTP server on the standard ports 20 and 21. The global variable `FTP` is set to the server object.
3535

3636
#### Syntax
37-
`FTP.createServer(user, pass[, dbgFlag])`
37+
`FTP:createServer(user, pass[, dbgFlag])`
3838

3939
#### Parameters
4040
- `user`: Username for access to the server
@@ -46,14 +46,14 @@ Create the FTP server on the standard ports 20 and 21. The global variable `FTP
4646

4747
#### Example
4848
```Lua
49-
require("ftpserver").createServer('user', 'password')
49+
require("ftpserver"):createServer('user', 'password')
5050
```
5151

5252
## open()
5353
Wrapper to createServer() which also connects to the WiFi channel.
5454

5555
#### Syntax
56-
`FTP.open(user, pass, ssid, wifipwd, dbgFlag)`
56+
`FTP:open(user, pass, ssid, wifipwd, dbgFlag)`
5757

5858
#### Parameters
5959
- `user`: Username for access to the server
@@ -67,14 +67,14 @@ Wrapper to createServer() which also connects to the WiFi channel.
6767

6868
#### Example
6969
```Lua
70-
require("ftpserver").open('user', 'password', 'myWifi', 'wifiPassword')
70+
require("ftpserver"):open('user', 'password', 'myWifi', 'wifiPassword')
7171
```
7272

7373
## close()
7474
Close down server including any sockets and return all resources to Lua. Note that this include removing the FTP global variable and package references.
7575

7676
#### Syntax
77-
`FTP.close()`
77+
`FTP:close()`
7878

7979
#### Parameters
8080
None
@@ -84,5 +84,5 @@ None
8484

8585
#### Example
8686
```Lua
87-
FTP.close()
87+
FTP:close()
8888
```

docs/lua-modules/httpserver.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Callback function has 2 arguments: `req` (request) and `res` (response). The fir
3838
- `url`: Requested URL
3939
- `onheader`: assign a function to this value which will be called as soon as HTTP headers like `content-type` are available.
4040
This handler function has 3 parameters:
41-
4241
- `self`: `req` object
4342
- `name`: Header name. Will allways be lowercase.
4443
- `value`: Header value
@@ -51,20 +50,18 @@ Callback function has 2 arguments: `req` (request) and `res` (response). The fir
5150
The second object holds functions:
5251

5352
- `send(self, data, [response_code])`: Function to send data to client.
54-
55-
- `self`: `res` object
56-
- `data`: data to send (may be nil)
57-
- `response_code`: the HTTP response code like `200`(default) or `404` (for example) *NOTE* if there are several calls with response_code given only the first one will be used. Any further codes given will be ignored.
53+
- `self`: `res` object
54+
- `data`: data to send (may be nil)
55+
- `response_code`: the HTTP response code like `200`(default) or `404` (for example) *NOTE* if there are several calls with response_code given only the first one will be used. Any further codes given will be ignored.
5856

5957
- `send_header(self, header_name, header_data)`: Function to send HTTP headers to client. This function will not be available after data has been sent. (It will be nil.)
60-
61-
- `self`: `res` object
62-
- `header_name`: the HTTP header name
63-
- `header_data`: the HTTP header data
58+
- `self`: `res` object
59+
- `header_name`: the HTTP header name
60+
- `header_data`: the HTTP header data
6461

6562
- `finish([data[, response_code]])`: Function to finalize connection, optionally sending data and return code.
6663

67-
- `data`: optional data to send on connection finalizing
68-
- `response_code`: the HTTP response code like `200`(default) or `404` (for example) *NOTE* if there are several calls with response_code given only the first one will be used. Any further codes given will be ignored.
64+
- `data`: optional data to send on connection finalizing
65+
- `response_code`: the HTTP response code like `200`(default) or `404` (for example) *NOTE* if there are several calls with response_code given only the first one will be used. Any further codes given will be ignored.
6966

7067
Full example can be found in [http-example.lua](../../lua_modules/http/http-example.lua)

0 commit comments

Comments
 (0)