Skip to content

Commit 2c45e6f

Browse files
vsemozhetbytjasnell
authored andcommitted
doc: update code example for Windows in stream.md
PR-URL: #13138 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 3c91145 commit 2c45e6f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/api/stream.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const server = http.createServer((req, res) => {
134134
res.write(typeof data);
135135
res.end();
136136
} catch (er) {
137-
// uh oh! bad json!
137+
// uh oh! bad json!
138138
res.statusCode = 400;
139139
return res.end(`error: ${er.message}`);
140140
}
@@ -143,12 +143,12 @@ const server = http.createServer((req, res) => {
143143

144144
server.listen(1337);
145145

146-
// $ curl localhost:1337 -d '{}'
146+
// $ curl localhost:1337 -d "{}"
147147
// object
148-
// $ curl localhost:1337 -d '"foo"'
148+
// $ curl localhost:1337 -d "\"foo\""
149149
// string
150-
// $ curl localhost:1337 -d 'not json'
151-
// error: Unexpected token o
150+
// $ curl localhost:1337 -d "not json"
151+
// error: Unexpected token o in JSON at position 1
152152
```
153153

154154
[Writable][] streams (such as `res` in the example) expose methods such as

0 commit comments

Comments
 (0)