Skip to content

Commit 2111120

Browse files
committed
doc/modules/http.h1_reason_phrases: Split out from http.h1_connection docs
1 parent 4bb89ce commit 2111120

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

doc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ MODULES = \
66
http.bit.md \
77
http.client.md \
88
http.h1_connection.md \
9+
http.h1_reason_phrases.md \
910
http.h1_stream.md \
1011
http.h2_connection.md \
1112
http.h2_error.md \

doc/modules/http.h1_connection.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,3 @@ Writes the chunked body terminator `"0\r\n"` to the socket and flushes the socke
158158
### `h1_connection:write_body_plain(body, timeout)` <!-- --> {#http.h1_connection:write_body_plain}
159159

160160
Writes the contents of `body` to the socket and flushes the socket output buffer immediately. Yields until success or `timeout` is exceeded. Returns `nil`, an error message and an error number if the write fails.
161-
162-
163-
## http.h1_reason_phrases
164-
165-
A table mapping from status codes (as strings) to reason phrases for HTTP 1. Any unknown status codes return `"Unassigned"`
166-
167-
168-
### Example {#http.h1_reason_phrases-example}
169-
170-
```lua
171-
local reason_phrases = require "http.h1_reason_phrases"
172-
print(reason_phrases["200"]) --> "OK"
173-
print(reason_phrases["342"]) --> "Unassigned"
174-
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## http.h1_reason_phrases
2+
3+
A table mapping from status codes (as strings) to reason phrases for HTTP 1. Any unknown status codes return `"Unassigned"`
4+
5+
### Example {#http.h1_reason_phrases-example}
6+
7+
```lua
8+
local reason_phrases = require "http.h1_reason_phrases"
9+
print(reason_phrases["200"]) --> "OK"
10+
print(reason_phrases["342"]) --> "Unassigned"
11+
```

0 commit comments

Comments
 (0)