sprucehttp_sjs 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ A module for responding to requests within SpruceHTTP in an SJS file.
|
|
|
6
6
|
- [Documentation](#documentation)
|
|
7
7
|
- [streamMode()](#streammode)
|
|
8
8
|
- [writeStatusLine(statusCode, reasonPhrase)](#writestatuslinestatuscode-reasonphrase)
|
|
9
|
-
- [writeHeader(name, value)](#
|
|
9
|
+
- [writeHeader(name, value)](#writeheadername-value)
|
|
10
10
|
- [writeData(data)](#writedatadata)
|
|
11
11
|
|
|
12
12
|
## Documentation:
|
|
@@ -24,7 +24,7 @@ Stream mode means that responses are not buffered by the webserver, and thus are
|
|
|
24
24
|
sjs.streamMode(); // Set the response to stream mode.
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
### ``writeStatusLine(statusCode[, reasonPhrase])
|
|
27
|
+
### ``writeStatusLine(statusCode[, reasonPhrase])``:
|
|
28
28
|
- ``statusLine:`` number: The HTTP status code to send.
|
|
29
29
|
- ``reasonPhrase:`` string: The reason phrase to send.
|
|
30
30
|
|
|
@@ -40,7 +40,7 @@ To send a 418 "I'm a teapot" response, with a specified reason phrase.
|
|
|
40
40
|
sjs.writeStatusLine(418, "I'm a teapot");
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
### ``writeHeader(name, value)
|
|
43
|
+
### ``writeHeader(name, value)``:
|
|
44
44
|
- ``name:`` string: The name of the header to send.
|
|
45
45
|
- ``value:`` string: The value of the header to send.
|
|
46
46
|
|
|
@@ -51,7 +51,7 @@ To write the "Content-Type: text/html" header.
|
|
|
51
51
|
sjs.writeHeader("Content-Type", "text/html");
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
### ``writeData(data)
|
|
54
|
+
### ``writeData(data)``:
|
|
55
55
|
- ``data:`` string | Buffer: The data to send.
|
|
56
56
|
|
|
57
57
|
Writes data (the body) to the response. When not in stream mode, the Content-Length header is automatically updated.
|