| Crates.io | actix-xml |
| lib.rs | actix-xml |
| version | 0.2.0 |
| created_at | 2021-07-11 18:35:17.007232+00 |
| updated_at | 2022-02-26 12:48:13.236166+00 |
| description | XML extractor for actix-web |
| homepage | |
| repository | https://github.com/PhotonQuantum/actix-xml |
| max_upload_size | |
| id | 421518 |
| size | 22,364 |
XML extractor for actix-web.
This crate provides struct Xml that can be used to extract typed information from request's body.
Under the hood, quick-xml is used to parse payloads.
use actix_web::{web, App};
use actix_xml::Xml;
use serde::Deserialize;
#[derive(Deserialize)]
struct Info {
username: String,
}
/// deserialize `Info` from request's body
async fn index(info: Xml<Info>) -> String {
format!("Welcome {}!", info.username)
}
fn main() {
let app = App::new().service(
web::resource("/index.html").route(
web::post().to(index))
);
}
encoding: support non utf-8 payloadcompress-brotli(default): enable actix-web compress-brotli supportcompress-gzip(default): enable actix-web compress-gzip supportcompress-zstd(default): enable actix-web compress-zstd supportIf you've removed one of the compress-* feature flag for actix-web, make sure to remove it by
setting default-features=false, or it will be re-enabled for actix-web.
0.1.x - supports actix-web 3.3.x0.2.0-beta.0 - supports actix-web 4.0.0.beta.80.2.0 - supports actix-web 4.0.xMIT