http-rs / vcr-cassette

Serializer and deserializer for the VCR Cassette format
Apache License 2.0
14 stars 2 forks source link

Support `base64_body` #1

Open yoshuawuyts opened 3 years ago

yoshuawuyts commented 3 years ago

According to this VCR cassette files should be able to support base64 encoded strings too. This means we need to add support for base64_body to our Body type.

Examples

pub enum BodyKind {
    Base64,
    String,
}
pub struct Body {
    pub encoding: Option<String>,
    pub string: String,
    pub kind: BodyKind,
}

or

pub enum BodyString {
    Base64(String),
    String(String),
}
pub struct Body {
    pub encoding: Option<String>,
    pub string: BodyString,
}