pub async fn request<U: Clone + IntoUrl>(
        &self,
        method: Method,
        url: U,
        scope: &Scope,
    ) -> Result<RequestBuilder> {
        let headers = self
            .authenticate(method.clone(), url.clone(), scope)
            .await?;
        Ok(self.client.request(method, url).headers(headers.clone()))
    }
/// Wrapper around [ReqwestClient::request] which appends authentication
/// headers. Unlike [ReqwestClient::request], this method is async, as it
/// _may_ perform some authentication flow HTTP requests prior to returning
/// the RequestBuilder.
///
/// The `scope` variable is the caller's "best guess" as to what the scope
/// for the request should be. If the guess is incorrect, the normal
/// authentication flow will still proceed, though the discrepancy will
/// be noted in the logs.
// TODO: Infer best-guess scopes from URLs.
// e.g: using regex to infer /v2/ endpoint from URL. This would be slower than
// the current approach, but would enable dynamically updating scope guesses,
// and better encapsulation.
Wrapper around [ReqwestClient::request] which appends authentication
headers. Unlike [ReqwestClient::request], this method is async, as it
_may_ perform some authentication flow HTTP requests prior to returning
the RequestBuilder.

The `scope` variable is the caller's "best guess" as to what the scope
for the request should be. If the guess is incorrect, the normal
authentication flow will still proceed, though the discrepancy will
be noted in the logs.
TODO: Infer best-guess scopes from URLs.
e.g: using regex to infer /v2/ endpoint from URL. This would be slower than
the current approach, but would enable dynamically updating scope guesses,
and better encapsulation.
Wrapper around [ ReqwestClient :: request ] which appends authentication headers . Unlike [ ReqwestClient :: request ] this method is async as it _may_ perform some authentication flow HTTP requests prior to returning the RequestBuilder . The ` scope ` variable is the caller ' s " best guess " as to what the scope for the request should be . If the guess is incorrect the normal authentication flow will still proceed though the discrepancy will be noted in the logs . TODO : Infer best - guess scopes from URLs . e . g : using regex to infer / v2 / endpoint from URL . This would be slower than the current approach but would enable dynamically updating scope guesses and better encapsulation .
pub async fn request<U: Clone + IntoUrl>(
        &self,
        method: Method,
        url: U,
        scope: &Scope,
    ) -> Result<RequestBuilder> {
        let headers = self
            .authenticate(method.clone(), url.clone(), scope)
            .await?;
        Ok(self.client.request(method, url).headers(headers.clone()))
    }
pub async fn request < U : Clone + IntoUrl > ( & self , method : Method , url : U , scope : & Scope , ) -> Result < RequestBuilder > { let headers = self . authenticate ( method . clone ( ) , url . clone ( ) , scope ) . await ? ; Ok ( self . client . request ( method , url ) . headers ( headers . clone ( ) ) ) }
Wrapper around [ReqwestClient::request] which appends authentication
headers.
Wrapper around [ ReqwestClient :: request ] which appends authentication headers .
&self
method
Method
url
U
scope
&Scope
&self
method
Method
url
U
scope
&Scope