pub async fn write_line_protocol(
        &self,
        org: &str,
        bucket: &str,
        body: impl Into<Body> + Send,
    ) -> Result<(), RequestError> {
        let body = body.into();
        let write_url = format!("{}/api/v2/write", self.url);

        let response = self
            .request(Method::POST, &write_url)
            .query(&[("bucket", bucket), ("org", org)])
            .body(body)
            .send()
            .await
            .context(ReqwestProcessing)?;

        if !response.status().is_success() {
            let status = response.status();
            let text = response.text().await.context(ReqwestProcessing)?;
            Http { status, text }.fail()?;
        }

        Ok(())
    }
/// Write line protocol data to the specified organization and bucket.
Write line protocol data to the specified organization and bucket.
Write line protocol data to the specified organization and bucket .
pub async fn write_line_protocol(
        &self,
        org: &str,
        bucket: &str,
        body: impl Into<Body> + Send,
    ) -> Result<(), RequestError> {
        let body = body.into();
        let write_url = format!("{}/api/v2/write", self.url);
        let response = self
            .request(Method::POST, &write_url)
            .query(&[("bucket", bucket), ("org", org)])
            .body(body)
            .send()
            .await
            .context(ReqwestProcessing)?;
        if !response.status().is_success() {
            let status = response.status();
            let text = response.text().await.context(ReqwestProcessing)?;
            Http { status, text }.fail()?;
        }
        Ok(())
    }
pub async fn write_line_protocol ( & self , org : & str , bucket : & str , body : impl Into < Body > + Send , ) -> Result < ( ) , RequestError > { let body = body . into ( ) ; let write_url = format ! ( " " self url ) ; let response = self . request ( Method :: POST , & write_url ) . query ( & [ ( " " , bucket ) , ( " " , org ) ] ) . body ( body ) . send ( ) . await . context ( ReqwestProcessing ) ? ; if ! response . status ( ) . is_success ( ) { let status = response . status ( ) ; let text = response . text ( ) . await . context ( ReqwestProcessing ) ? ; Http { status , text } . fail ( ) ? ; } Ok ( ( ) ) }
Write line protocol data to the specified organization and bucket.
Write line protocol data to the specified organization and bucket .
&self
org
&str
bucket
&str
body
impl Into<Body> + Send
&self
org
&str
bucket
&str
body
impl Into<Body> + Send