Trim: docs/api/net.md

This commit is contained in:
tinydew4 2016-11-01 03:05:23 +00:00
parent 721924b749
commit 836cd017a9

View file

@ -78,8 +78,8 @@ interface and is therefore an [EventEmitter](https://nodejs.org/api/events.html#
### `new ClientRequest(options)` ### `new ClientRequest(options)`
* `options` (Object | String) - If `options` is a String, it is interpreted as * `options` (Object | String) - If `options` is a String, it is interpreted as
the request URL. If it is an object, it is expected to fully specify an HTTP request via the the request URL. If it is an object, it is expected to fully specify an HTTP
following properties: request via the following properties:
* `method` String (optional) - The HTTP request method. Defaults to the GET * `method` String (optional) - The HTTP request method. Defaults to the GET
method. method.
* `url` String (optional) - The request URL. Must be provided in the absolute * `url` String (optional) - The request URL. Must be provided in the absolute
@ -146,6 +146,7 @@ request.on('login', (authInfo, callback) => {
callback('username', 'password') callback('username', 'password')
}) })
``` ```
Providing empty credentials will cancel the request and report an authentication Providing empty credentials will cancel the request and report an authentication
error on the response object: error on the response object:
@ -259,7 +260,6 @@ Cancels an ongoing HTTP transaction. If the request has already emitted the
event will emit `abort` and `close` events. Additionally, if there is an ongoing event will emit `abort` and `close` events. Additionally, if there is an ongoing
response object,it will emit the `aborted` event. response object,it will emit the `aborted` event.
## Class: IncomingMessage ## Class: IncomingMessage
> Handle responses to HTTP/HTTPS requests. > Handle responses to HTTP/HTTPS requests.