pub fn post<R>(&self, endpoint: &str) -> api::Result<R>
    where
        R: DeserializeOwned + 'static,
    {
        let url = format!(
            "{url}{access}/{prefix}/{endpoint}",
            url = self.test_server_url,
            access = format!("{}", self.access).to_lowercase(),
            prefix = self.prefix,
            endpoint = endpoint
        );

        trace!("POST {}", url);

        let builder = self.test_client.post(&url);
        let builder = if let Some(ref query) = self.query.as_ref() {
            trace!("Body: {}", serde_json::to_string_pretty(&query).unwrap());
            builder.json(query)
        } else {
            builder.json(&serde_json::Value::Null)
        };
        let response = builder.send().expect("Unable to send request");
        Self::response_to_api_result(response)
    }
/// Sends a post request to the testing API endpoint and decodes response as
/// the corresponding type.
Sends a post request to the testing API endpoint and decodes response as
the corresponding type.
Sends a post request to the testing API endpoint and decodes response as the corresponding type .
pub fn post<R>(&self, endpoint: &str) -> api::Result<R>
    where
        R: DeserializeOwned + 'static,
    {
        let url = format!(
            "{url}{access}/{prefix}/{endpoint}",
            url = self.test_server_url,
            access = format!("{}", self.access).to_lowercase(),
            prefix = self.prefix,
            endpoint = endpoint
        );
        trace!("POST {}", url);
        let builder = self.test_client.post(&url);
        let builder = if let Some(ref query) = self.query.as_ref() {
            trace!("Body: {}", serde_json::to_string_pretty(&query).unwrap());
            builder.json(query)
        } else {
            builder.json(&serde_json::Value::Null)
        };
        let response = builder.send().expect("Unable to send request");
        Self::response_to_api_result(response)
    }
pub fn post < R > ( & self , endpoint : & str ) -> api :: Result < R > where R : DeserializeOwned + ' static , { let url = format ! ( " " url self test_server_url access format ( " " self access ) to_lowercase ( ) prefix self prefix endpoint endpoint ) ; trace ! ( " " url ) ; let builder = self . test_client . post ( & url ) ; let builder = if let Some ( ref query ) = self . query . as_ref ( ) { trace ! ( " " serde_json to_string_pretty ( query ) unwrap ( ) ) ; builder . json ( query ) } else { builder . json ( & serde_json :: Value :: Null ) } ; let response = builder . send ( ) . expect ( " " ) ; Self :: response_to_api_result ( response ) }
Sends a post request to the testing API endpoint and decodes response as
the corresponding type.
Sends a post request to the testing API endpoint and decodes response as the corresponding type .
&self
endpoint
&str
&self
endpoint
&str