/// Writes the line protocol to the write_base/api/v2/write endpoint (typically on the router)
Writes the line protocol to the write_base/api/v2/write endpoint (typically on the router)
Writes the line protocol to the write_base / api / v2 / write endpoint ( typically on the router )
pub async fn write_to_router(
    line_protocol: impl Into<String>,
    org: impl AsRef<str>,
    bucket: impl AsRef<str>,
    write_base: impl AsRef<str>,
) -> Response<Body> {
    let client = Client::new();
    let url = format!(
        "{}/api/v2/write?org={}&bucket={}",
        write_base.as_ref(),
        org.as_ref(),
        bucket.as_ref()
    );
    let request = Request::builder()
        .uri(url)
        .method("POST")
        .body(Body::from(line_protocol.into()))
        .expect("failed to construct HTTP request");
    client
        .request(request)
        .await
        .expect("http error sending write")
}
pub async fn write_to_router ( line_protocol : impl Into < String > , org : impl AsRef < str > , bucket : impl AsRef < str > , write_base : impl AsRef < str > , ) -> Response < Body > { let client = Client :: new ( ) ; let url = format ! ( " " write_base as_ref ( ) org as_ref ( ) bucket as_ref ( ) ) ; let request = Request :: builder ( ) . uri ( url ) . method ( " " ) . body ( Body :: from ( line_protocol . into ( ) ) ) . expect ( " " ) ; client . request ( request ) . await . expect ( " " ) }
Writes the line protocol to the write_base/api/v2/write endpoint (typically on the router)
Writes the line protocol to the write_base / api / v2 / write endpoint ( typically on the router )
line_protocol
impl Into<String>
org
impl AsRef<str>
bucket
impl AsRef<str>
write_base
impl AsRef<str>