pub fn construct_url(
base_url: &str,
endpoint: &str,
params: &impl Serialize,
query: &impl Serialize,
) -> Result<String, IntoHttpError>Expand description
Constructs a complete URL from a base URL, an endpoint, and parameters.
- The
base_urlis the base URL of the API:https://api.trakt.tv. - The
endpointis the path of the specific endpoint with parameters enclosed in curly braces:/shows/{id}/seasons/{season}/episodes/{episode}. - The
paramsis a struct that will be serialized into the parameters of theendpoint. - The
queryis a struct that will be serialized into the query parameters of the URL.
ยงErrors
Returns an IntoHttpError if the URL cannot be constructed.