Skip to main content

serde_urlencoded/
lib.rs

1//! `x-www-form-urlencoded` meets Serde.
2//!
3//! This crate serialises to and deserialises from the
4//! [`application/x-www-form-urlencoded`][urlencoded] format. It is built upon
5//! [Serde], a high performance generic serialization framework, and the
6//! `form_urlencoded` crate in this workspace.
7//!
8//! [urlencoded]: https://url.spec.whatwg.org/#application/x-www-form-urlencoded
9//! [Serde]: https://github.com/serde-rs/serde
10//!
11//! # Example
12//!
13//! ```
14//! let params = vec![("key", "value"), ("foo", "bar")];
15//! let body = serde_urlencoded::to_string(&params).unwrap();
16//! assert_eq!(body, "key=value&foo=bar");
17//! ```
18#![warn(unused_extern_crates)]
19#![forbid(unsafe_code)]
20
21pub mod de;
22pub mod ser;
23
24#[doc(inline)]
25pub use crate::de::{Deserializer, from_bytes, from_reader, from_str};
26#[doc(inline)]
27pub use crate::ser::{Serializer, to_string};