// get request that requests the details of a specific model
get request that requests the details of a specific model
get request that requests the details of a specific model
pub async fn engine(&self, engine_id: &str) -> Result<(), Box<dyn std::error::Error>> {
            let client = reqwest::Client::new();
            let mut headers = HeaderMap::new();
            // creates REST api header using the user's api key
            headers.insert(
                AUTHORIZATION,
                format!("Bearer {}", &self._api_key)
                    .parse::<HeaderValue>()
                    .unwrap(),
            );
            // get request
            let resp = client
                .get(format!("{}/engines/{}", &self._base_url, &engine_id))
                .headers(headers)
                .send()
                .await?;
            // deserializing into Engine
            let json = resp.json::<Engine>().await?;
            println!("{:#?}", json);
            Ok(())
        }
pub async fn engine ( & self , engine_id : & str ) -> Result < ( ) , Box < dyn std :: error :: Error > > { let client = reqwest :: Client :: new ( ) ; let mut headers = HeaderMap :: new ( ) ; // creates REST api header using the user's api key headers . insert ( AUTHORIZATION , format ! ( " " self api_key ) . parse :: < HeaderValue > ( ) . unwrap ( ) , ) ; // get request let resp = client . get ( format ! ( " " self base_url engine_id ) ) . headers ( headers ) . send ( ) . await ? ; // deserializing into Engine let json = resp . json :: < Engine > ( ) . await ? ; println ! ( " " json ) ; Ok ( ( ) ) }
get request that requests the details of a specific model
get request that requests the details of a specific model
&self
engine_id
&str