A basic http client with the option of adding default headers,
and the option of using a baseUrl.
Note: If the path given starts with https://, the baseUrl is ignored.
It handles query parameters, and request body data which gets encoded as json if needed.
See HttpRequest.
The
BasicHttpClientclass provides a simplified HTTP client for making requests to a server. It abstracts away the underlying HTTP client and the complexities of handling different response types and error handling, making it easier to interact with HTTP APIs.This class includes static methods for:
The
BasicHttpClientis designed to be used in scenarios where you need to make HTTP requests and handle responses in a consistent and predictable manner. It ensures that responses are correctly parsed and that errors are properly propagated, allowing for robust error handling.Remarks
This class relies on the
cross-fetchlibrary for making HTTP requests, and it uses custom error and header types defined in the project.See