Skip to main content

write_entry

Function write_entry 

pub async fn write_entry<W>(
    writer: &mut W,
    entry: &Entry,
    request_body: &impl HarBody,
    request_stats: &BodyStats,
    response_body: &impl HarBody,
    response_stats: &BodyStats,
    extension: &impl HarEntryExtension,
) -> Result<(), Box<dyn Error + Send + Sync>>
where W: AsyncWrite + Unpin + Send,
Available on crate features http and std only.
Expand description

Serialize a typed HAR entry with streamed bodies and protocol-owned extensions. Metadata is serialized with Serde; only body fields require incremental JSON escaping. A cancelled write may leave partial output, so stage published files. Existing post parameters are preserved. For application/x-www-form-urlencoded bodies, absent or empty parameters are derived from the nonempty body stream.