Package africa.sendbyte.http
Interface HttpTransport
- All Known Implementing Classes:
OkHttpTransport
public interface HttpTransport
Abstraction over the underlying HTTP client.
The default implementation is OkHttpTransport. Tests inject a stub
so no network calls are made. Implementations are responsible for applying the
base URL, the Authorization bearer header, and JSON content headers.
Internal SDK type.
-
Method Details
-
execute
SendByteResponse execute(String method, String url, Map<String, String> headers, String jsonBody) throws IOExceptionExecute a request synchronously.- Throws:
IOException
-
executeAsync
CompletableFuture<SendByteResponse> executeAsync(String method, String url, Map<String, String> headers, String jsonBody) Execute a request asynchronously. -
baseUrl
String baseUrl()The base URL (including scheme and version prefix) requests are sent to. -
close
default void close()Release any underlying resources. Optional.
-