Interface: IHttpClient
HTTP Client interface (Port) Defines the contract for HTTP operations in the SDK. Following hexagonal architecture, this is a port that can be implemented by different adapters (fetch, axios, etc.)
Example
T
Methods
delete()
unknown
Performs a DELETE request
Type Parameters
T
T = unknown
Parameters
url
string
The URL to delete
options?
Optional request configuration
Returns
Promise<HttpResponse<T>>
Promise resolving to HttpResponse
get()
string
Performs a GET request
Type Parameters
T
T = unknown
Parameters
url
string
The URL to fetch
options?
Optional request configuration
Returns
Promise<HttpResponse<T>>
Promise resolving to HttpResponse
post()
HttpRequestOptions
Performs a POST request
Type Parameters
T
T = unknown
Parameters
url
string
The URL to post to
body
unknown
The request body (will be JSON stringified)
options?
Optional request configuration
Returns
Promise<HttpResponse<T>>
Promise resolving to HttpResponse
put()
Promise
Performs a PUT request
Type Parameters
T
T = unknown
Parameters
url
string
The URL to put to
body
unknown
The request body (will be JSON stringified)
options?
Optional request configuration
Returns
Promise<HttpResponse<T>>
Promise resolving to HttpResponse