performMultipartDataTask

suspend fun performMultipartDataTask(endpoint: FrameNetworkingEndpoints, filesToUpload: List<FileUpload>, auth: FrameAuthMode = FrameAuthMode.Secret): Pair<ByteArray?, NetworkingError?>

Executes a multipart POST to endpoint, uploading each FileUpload as a form-data part.

Return

A pair of (response bytes, error).

Parameters

endpoint

The endpoint to call.

filesToUpload

One or more document images to include in the upload.

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 performMultipartDataTask(endpoint: FrameNetworkingEndpoints, filesToUpload: List<FileUpload>, auth: FrameAuthMode = FrameAuthMode.Secret, completion: (data: ByteArray?, error: NetworkingError?) -> Unit)

Callback-based multipart POST for callers that cannot use coroutines.

Parameters

endpoint

The endpoint to call.

filesToUpload

One or more document images to include in the upload.

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.