File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ const server = http.createServer((req, res) => {
134
134
res .write (typeof data);
135
135
res .end ();
136
136
} catch (er) {
137
- // uh oh! bad json!
137
+ // uh oh! bad json!
138
138
res .statusCode = 400 ;
139
139
return res .end (` error: ${ er .message } ` );
140
140
}
@@ -143,12 +143,12 @@ const server = http.createServer((req, res) => {
143
143
144
144
server .listen (1337 );
145
145
146
- // $ curl localhost:1337 -d '{}'
146
+ // $ curl localhost:1337 -d "{}"
147
147
// object
148
- // $ curl localhost:1337 -d '" foo"'
148
+ // $ curl localhost:1337 -d "\" foo\""
149
149
// 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
152
152
```
153
153
154
154
[ Writable] [ ] streams (such as ` res ` in the example) expose methods such as
You can’t perform that action at this time.
0 commit comments