performDataTask

suspend fun performDataTask(endpoint: FrameNetworkingEndpoints, usePublishableKey: Boolean = false): Pair<ByteArray?, NetworkingError?>

Executes a GET or DELETE request to endpoint and returns the raw response bytes.

Return

A pair of (response bytes, error). On success the error is null; on failure the bytes may contain an error body.

Parameters

endpoint

The endpoint to call.

usePublishableKey

When true, the publishable key is used instead of the secret key.


fun performDataTask(endpoint: FrameNetworkingEndpoints, usePublishableKey: Boolean = false, completion: (data: ByteArray?, error: NetworkingError?) -> Unit)

Callback-based GET/DELETE for callers that cannot use coroutines.

Parameters

endpoint

The endpoint to call.

usePublishableKey

When true, the publishable key is used instead of the secret key.

completion

Called on an OkHttp worker thread with the response bytes and any error.