pub async fn send_request<T: DeserializeOwned + Send + 'static>(
configuration: &ConfigurationRestApi,
endpoint: &str,
method: Method,
params: BTreeMap<String, Value>,
time_unit: Option<TimeUnit>,
is_signed: bool,
) -> Result<RestApiResponse<T>>Expand description
Sends an HTTP request to a REST API endpoint with optional authentication and configuration.
§Parameters
configuration: REST API configuration containing client, base path, and authentication detailsendpoint: The specific API endpoint path to send the request tomethod: HTTP method for the request (GET, POST, etc.)params: Parameters to be sent with the request, as a key-value maptime_unit: Optional time unit for the request headeris_signed: Optional flag to indicate whether the request requires authentication
§Returns
A RestApiResponse containing the deserialized response data, or an error if the request fails
§Panics
This function will panic if any of the following .unwrap() calls fail:
- Parsing the literal
"application/json"into a header value (should never fail) - Parsing
configuration.user_agentorconfiguration.api_keyinto header values - Parsing the literal
"gzip, deflate, br"into a header value whencompressionis enabled
§Errors
Returns an anyhow::Result which can contain various connector-related errors during request processing