pub async fn delete_kv_value(&self, key: &str) -> Result<(), Error> {
        let url = format!(
            "{}/accounts/{}/storage/kv/namespaces/{}/values/{}",
            CLOUDFLARE_KV_ENDPOINT, &self.account_id, &self.namespace_id, key,
        );
        let client = reqwest::Client::new();
        let resp = client
            .delete(&url)
            .header("Authorization", format!("Bearer {}", self.auth_token))
            .send()
            .await
            .map_err(|e| Error::KVHttp(e.to_string(), String::new()))?;
        let status = resp.status();
        let bytes = resp
            .bytes()
            .await
            .map_err(|e| Error::KVHttp(e.to_string(), String::new()))?;
        if !status.is_success() {
            return Err(Error::KVHttpStatus(
                status.as_u16(),
                String::from_utf8_lossy(&bytes).to_string(),
            ));
        }
        Ok(())
    }
/// Delete the key at path.
Delete the key at path.
Delete the key at path .
pub async fn delete_kv_value(&self, key: &str) -> Result<(), Error> {
        let url = format!(
            "{}/accounts/{}/storage/kv/namespaces/{}/values/{}",
            CLOUDFLARE_KV_ENDPOINT, &self.account_id, &self.namespace_id, key,
        );
        let client = reqwest::Client::new();
        let resp = client
            .delete(&url)
            .header("Authorization", format!("Bearer {}", self.auth_token))
            .send()
            .await
            .map_err(|e| Error::KVHttp(e.to_string(), String::new()))?;
        let status = resp.status();
        let bytes = resp
            .bytes()
            .await
            .map_err(|e| Error::KVHttp(e.to_string(), String::new()))?;
        if !status.is_success() {
            return Err(Error::KVHttpStatus(
                status.as_u16(),
                String::from_utf8_lossy(&bytes).to_string(),
            ));
        }
        Ok(())
    }
pub async fn delete_kv_value ( & self , key : & str ) -> Result < ( ) , Error > { let url = format ! ( " " CLOUDFLARE_KV_ENDPOINT self account_id self namespace_id key ) ; let client = reqwest :: Client :: new ( ) ; let resp = client . delete ( & url ) . header ( " " , format ! ( " " self auth_token ) ) . send ( ) . await . map_err ( | e | Error :: KVHttp ( e . to_string ( ) , String :: new ( ) ) ) ? ; let status = resp . status ( ) ; let bytes = resp . bytes ( ) . await . map_err ( | e | Error :: KVHttp ( e . to_string ( ) , String :: new ( ) ) ) ? ; if ! status . is_success ( ) { return Err ( Error :: KVHttpStatus ( status . as_u16 ( ) , String :: from_utf8_lossy ( & bytes ) . to_string ( ) , ) ) ; } Ok ( ( ) ) }
Delete the key at path.
Delete the key at path .
&self
key
&str
&self
key
&str