Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
doc: update output examples in http.md
  • Loading branch information
vsemozhetbyt committed Apr 2, 2017
commit 317d2136ce3cd5c47f5d7afd77814a20e8e9ce5a
32 changes: 23 additions & 9 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1466,12 +1466,19 @@ can be used. Example:
```txt
$ node
> require('url').parse('/status?name=ryan')
{
href: '/status?name=ryan',
Url {
protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: '?name=ryan',
query: 'name=ryan',
pathname: '/status'
}
pathname: '/status',
path: '/status?name=ryan',
href: '/status?name=ryan' }
```

To extract the parameters from the query string, the
Expand All @@ -1482,12 +1489,19 @@ Example:
```txt
$ node
> require('url').parse('/status?name=ryan', true)
{
href: '/status?name=ryan',
Url {
protocol: null,
slashes: null,
auth: null,
host: null,
port: null,
hostname: null,
hash: null,
search: '?name=ryan',
query: {name: 'ryan'},
pathname: '/status'
}
query: { name: 'ryan' },
pathname: '/status',
path: '/status?name=ryan',
href: '/status?name=ryan' }
```

## http.METHODS
Expand Down