Serde support for the HTTP crate
Adds ability to serialize and deserialize types from the HTTP crate.
If you want to serialize Request
or Response
, use into_parts()
and serialize their parts, and then rebuild them using their Builder
.
Usage
You must annotate fields with #[serde(with = "http_serde::<appropriate method>")]
.
# use ;
There's also support for the types wrapped in an Option
. To use it, change the with
attribute prefix from http_serde::
to http_serde::option::
.
# use ;
Requirements
- Rust 1.56 or later.