feat: add getUploadProgress API to the net API (#14446)

This commit is contained in:
trop[bot] 2018-09-04 12:26:50 -05:00 committed by Charles Kerr
parent ce592a5705
commit 89a6f1efbb
6 changed files with 45 additions and 0 deletions

View file

@ -215,3 +215,17 @@ response object,it will emit the `aborted` event.
#### `request.followRedirect()`
Continues any deferred redirection request when the redirection mode is `manual`.
#### `request.getUploadProgress()`
Returns `Object`:
* `active` Boolean - Whether the request is currently active. If this is false
no other properties will be set
* `started` Boolean - Whether the upload has started. If this is false both
`current` and `total` will be set to 0.
* `current` Integer - The number of bytes that have been uploaded so far
* `total` Integer - The number of bytes that will be uploaded this request
You can use this method in conjunction with `POST` requests to get the progress
of a file upload or other data transfer.