Class: ProgressPlug

ProgressPlug

A class that performs HTTP POST and PUT requests, and allows for the progress of the uploaded data to be reported.

Constructor

new ProgressPlug()

Source:

Methods

post(body, mime, methodopt, progressInfoopt) → {Promise}

Perform an HTTP POST request, enabling progress callback notifications.
Parameters:
Name Type Attributes Default Description
body String The body of the POST.
mime String The mime type of the request, set in the `Content-Type` header.
method String <optional>
POST The HTTP method to use with the POST logic.
progressInfo Object <optional>
An object containing parameters to receive the progress notifications.
Properties
Name Type Attributes Description
size Number <optional>
The Number of bytes that are uploaded before a notification callback occurs.
callback function <optional>
A function that is called to notify about a progress event.
Source:
Returns:
A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
Type
Promise

put(body, mime, progressInfoopt) → {Promise}

Perform an HTTP PUT request, enabling progress callback notifications.
Parameters:
Name Type Attributes Description
body String The body of the PUT.
mime String The mime type of the request, set in the `Content-Type` header.
progressInfo Object <optional>
An object containing parameters to receive the progress notifications.
Properties
Name Type Attributes Description
size Number <optional>
The Number of bytes that are uploaded before a notification callback occurs.
callback function <optional>
A function that is called to notify about a progress event.
Source:
Returns:
A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
Type
Promise

ProgressPlug

new ProgressPlug(urlopt, params)

Construct a ProgressPlug object.
Parameters:
Name Type Attributes Description
url String <optional>
The initial URL for the Plug.
params Object The parameters that direct the construction and behavior of the Plug. See {@see Plug} for details.
Source:

Methods

post(body, mime, methodopt, progressInfoopt) → {Promise}

Perform an HTTP POST request, enabling progress callback notifications.
Parameters:
Name Type Attributes Default Description
body String The body of the POST.
mime String The mime type of the request, set in the `Content-Type` header.
method String <optional>
POST The HTTP method to use with the POST logic.
progressInfo Object <optional>
An object containing parameters to receive the progress notifications.
Properties
Name Type Attributes Description
size Number <optional>
The Number of bytes that are uploaded before a notification callback occurs.
callback function <optional>
A function that is called to notify about a progress event.
Source:
Returns:
A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
Type
Promise

put(body, mime, progressInfoopt) → {Promise}

Perform an HTTP PUT request, enabling progress callback notifications.
Parameters:
Name Type Attributes Description
body String The body of the PUT.
mime String The mime type of the request, set in the `Content-Type` header.
progressInfo Object <optional>
An object containing parameters to receive the progress notifications.
Properties
Name Type Attributes Description
size Number <optional>
The Number of bytes that are uploaded before a notification callback occurs.
callback function <optional>
A function that is called to notify about a progress event.
Source:
Returns:
A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
Type
Promise