Constructs an instance of SimpleHttpClient with the given base URL, timeout period and HTTP headers. The HTTP headers are used each time this client send a request to the URL, if not overwritten by the HttpParams of the method sending the request.
The base URL for HTTP requests.
Optionalheaders: HeadersInit = ...The default headers for HTTP requests.
Optionaltimeout: number = SimpleHttpClient.DEFAULT_TIMEOUTThe timeout duration in milliseconds.
ReadonlybaseURLReturn the root URL for the API endpoints.
ReadonlyheadersReadonlytimeoutReturn the amount of time in milliseconds before a timeout occurs when requesting with HTTP methods.
Static ReadonlyDEFAULT_Represent the default timeout duration for network requests in milliseconds.
Sends an HTTP GET request to the specified path with optional query parameters.
The endpoint path to which the HTTP GET request is sent.
Optionalparams: HttpParamsOptional parameters for the request, including query parameters, headers, body, and response validation. HttpParams.headers override SimpleHttpClient.headers.
A promise that resolves with the response of the GET request.
Executes an HTTP request with the specified method, path, and optional parameters.
The HTTP method to use for the request (e.g., GET, POST).
The URL path for the request. Leading slashes will be automatically removed.
Optionalparams: HttpParamsOptional parameters for the request, including query parameters, headers, body, and response validation. HttpParams.headers override SimpleHttpClient.headers.
A promise that resolves to the response of the HTTP request.
Makes an HTTP POST request to the specified path with optional parameters.
The endpoint to which the POST request is made.
Optionalparams: HttpParamsOptional parameters for the request, including query parameters, headers, body, and response validation. HttpParams.headers override SimpleHttpClient.headers.
A promise that resolves with the response from the server.
This class implements the HttpClient interface using the Fetch API.
The SimpleHttpClient allows making HttpMethod requests with timeout and base URL configuration.