Portal Requests
Coroutine-based HTTP transport used by every API class in the SDK.
HTTP error semantics (since 9.0.0):
200 / 204 → returns body / empty string.
400 Bad Request → throws io.portalhq.android.exceptions.PortalException.Api.HttpBadRequest carrying the raw body and the extracted error message. Exception: postEnclaveMPCApi passes
wrapErrorInJson = trueand receives the wrapped error body as a string instead (preserved for the MPC enclave parser).401 Unauthorized → throws io.portalhq.android.exceptions.PortalException.Api.HttpUnauthorized.
All other HTTP status codes (4xx ≥ 402, 5xx, -1) → throws io.portalhq.android.exceptions.PortalException.Api.HttpRequestFailed.
Transport-level I/O failures (DNS, connection timeouts, socket reads, payload writes) propagate as raw java.io.IOException — not wrapped.
disconnect() is guaranteed on every path via a try/finally wrapper.