Class: APIRequest

APIRequest(config, eventBus)

APIRequest helps to prepare and execute requests to the Box API. It supports retries, multipart uploads, and more.

Constructor

new APIRequest(config, eventBus)

Parameters:
Name Type Description
config Config Request-specific Config object
eventBus EventEmitter Event bus for the SDK instance
Source:

Methods

execute(callbackopt) → {void}

Executes the request with the given options. If a callback is provided, we'll handle the response via callbacks. Otherwise, the response will be streamed to via the stream property. You can access this stream with the getResponseStream() method.
Parameters:
Name Type Attributes Description
callback APIRequest~Callback <optional>
Callback for handling the response
Source:
Returns:
Type
void

execute(callbackopt) → {void}

Executes the request with the given options. If a callback is provided, we'll handle the response via callbacks. Otherwise, the response will be streamed to via the stream property. You can access this stream with the getResponseStream() method.
Parameters:
Name Type Attributes Description
callback APIRequest~Callback <optional>
Callback for handling the response
Source:
Returns:
Type
void

getResponseStream() → (nullable) {ReadableStream}

Return the response read stream for a request. This will be undefined until a stream-based request has been started.
Source:
Returns:
The response stream
Type
ReadableStream

getResponseStream() → (nullable) {ReadableStream}

Return the response read stream for a request. This will be undefined until a stream-based request has been started.
Source:
Returns:
The response stream
Type
ReadableStream