Skip to content

[ENHANCEMENT] Add support for raw/bytes response #160

Closed
@dodomorandi

Description

@dodomorandi

Is your feature request related to a problem? Please describe.
ElasticSearch supports cbor format, and it would be useful it given the smaller overhead over json and that in Rust the decoder is available and also a serde Serializer/Deserializer. However, in order to receive and decode cbor data, it is necessary to get the raw data from Response.

Describe the solution you'd like
Add the following to Response:

pub async fn bytes(self) -> Result<Bytes, ClientError>
{
    let bytes = self.0.bytes().await?;
    Ok(bytes)
}

Where Bytes is from the bytes crate as returned from reqwest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions