commit
0c8160bfe3
1 changed files with 18 additions and 18 deletions
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue