View Source ExOciSdk.HTTPClient behaviour (ex_oci_sdk v0.2.0)
Defines the behaviour for HTTP clients in ExOciSdk.
This module specifies the contract that all HTTP client implementations must follow. It provides type specifications and a callback for making HTTP requests.
Summary
Types
Callbacks
defines the dependencies necessary for the module
@callback request( method :: http_method(), url :: url(), body :: body(), headers :: headers(), options :: options() ) :: {:ok, response()} | {:error, error_reason()}
Makes an HTTP request.
Parameters
method
- HTTP method as atom (e.g.,:get
,:post
)url
- Full URL for the requestbody
- Request body as iodataheaders
- List of request headers as tuplesoptions
- Additional options for the request
Returns
{:ok, response}
- Successful response with status, headers and body{:error, reason}
- Error occurred during request