@@ -10,11 +10,10 @@ user is able to stream data.
1010
1111HTTP message headers are represented by an object like this:
1212
13- { 'content-length': '123'
14- , 'content-type': 'text/plain'
15- , 'connection': 'keep-alive'
16- , 'accept': '*/*'
17- }
13+ { 'content-length': '123',
14+ 'content-type': 'text/plain',
15+ 'connection': 'keep-alive',
16+ 'accept': '*/*' }
1817
1918Keys are lowercased. Values are not modified.
2019
@@ -182,22 +181,20 @@ If you would like to parse the URL into its parts, you can use
182181` require('url').parse(request.url) ` . Example:
183182
184183 node> require('url').parse('/status?name=ryan')
185- { href: '/status?name=ryan'
186- , search: '?name=ryan'
187- , query: 'name=ryan'
188- , pathname: '/status'
189- }
184+ { href: '/status?name=ryan',
185+ search: '?name=ryan',
186+ query: 'name=ryan',
187+ pathname: '/status' }
190188
191189If you would like to extract the params from the query string,
192190you can use the ` require('querystring').parse ` function, or pass
193191` true ` as the second argument to ` require('url').parse ` . Example:
194192
195193 node> require('url').parse('/status?name=ryan', true)
196- { href: '/status?name=ryan'
197- , search: '?name=ryan'
198- , query: { name: 'ryan' }
199- , pathname: '/status'
200- }
194+ { href: '/status?name=ryan',
195+ search: '?name=ryan',
196+ query: { name: 'ryan' },
197+ pathname: '/status' }
201198
202199
203200
@@ -266,8 +263,7 @@ Example:
266263 var body = 'hello world';
267264 response.writeHead(200, {
268265 'Content-Length': body.length,
269- 'Content-Type': 'text/plain'
270- });
266+ 'Content-Type': 'text/plain' });
271267
272268This method must only be called once on a message and it must
273269be called before ` response.end() ` is called.
0 commit comments