perform Data Task
suspend fun performDataTask(endpoint: FrameNetworkingEndpoints, auth: FrameAuthMode = FrameAuthMode.Secret): 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.
auth
The credential to use for this request. Defaults to FrameAuthMode.Secret, which fails safe to server-only; client-safe endpoints opt in with FrameAuthMode.Publishable.
fun performDataTask(endpoint: FrameNetworkingEndpoints, auth: FrameAuthMode = FrameAuthMode.Secret, completion: (data: ByteArray?, error: NetworkingError?) -> Unit)
Callback-based GET/DELETE for callers that cannot use coroutines.
Parameters
endpoint
The endpoint to call.
auth
The credential to use for this request. Defaults to FrameAuthMode.Secret, which fails safe to server-only; client-safe endpoints opt in with FrameAuthMode.Publishable.
completion
Called on an OkHttp worker thread with the response bytes and any error.