1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

remove json and url encoded form support from -http (#2148)

This commit is contained in:
Rob Ede
2021-04-12 10:30:28 +01:00
committed by GitHub
parent 44c55dd036
commit 981c54432c
15 changed files with 137 additions and 258 deletions

View File

@@ -174,13 +174,15 @@ mod tests {
#[actix_rt::test]
async fn test_serde_json() {
use serde_json::json;
use serde_json::{json, Value};
assert_eq!(
Body::from(serde_json::Value::String("test".into())).size(),
Body::from(serde_json::to_vec(&Value::String("test".to_owned())).unwrap())
.size(),
BodySize::Sized(6)
);
assert_eq!(
Body::from(json!({"test-key":"test-value"})).size(),
Body::from(serde_json::to_vec(&json!({"test-key":"test-value"})).unwrap())
.size(),
BodySize::Sized(25)
);
}