mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-04 21:37:58 +03:00
fmt
This commit is contained in:
parent
26daed37e6
commit
78f14e6d93
1 changed files with 13 additions and 8 deletions
|
@ -118,15 +118,16 @@ async fn test_json() {
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
|
|
||||||
// same with frozen request
|
// same with frozen request
|
||||||
let request = srv
|
let request = srv.get("/").header("x-test", "111").freeze().unwrap();
|
||||||
.get("/")
|
|
||||||
.header("x-test", "111")
|
|
||||||
.freeze().unwrap();
|
|
||||||
|
|
||||||
let response = request.send_json(&"TEST".to_string()).await.unwrap();
|
let response = request.send_json(&"TEST".to_string()).await.unwrap();
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
|
|
||||||
let response = request.extra_header("x-test2", "112").send_json(&"TEST".to_string()).await.unwrap();
|
let response = request
|
||||||
|
.extra_header("x-test2", "112")
|
||||||
|
.send_json(&"TEST".to_string())
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +151,11 @@ async fn test_form() {
|
||||||
let response = request.send_form(&data).await.unwrap();
|
let response = request.send_form(&data).await.unwrap();
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
|
|
||||||
let response = request.extra_header("x-test2", "112").send_form(&data).await.unwrap();
|
let response = request
|
||||||
|
.extra_header("x-test2", "112")
|
||||||
|
.send_form(&data)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -806,8 +811,8 @@ async fn client_read_until_eof() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// client request
|
// client request
|
||||||
let req = ntex::http::client::Client::default()
|
let req =
|
||||||
.get(format!("http://{}/", addr).as_str());
|
ntex::http::client::Client::default().get(format!("http://{}/", addr).as_str());
|
||||||
let mut response = req.send().await.unwrap();
|
let mut response = req.send().await.unwrap();
|
||||||
assert!(response.status().is_success());
|
assert!(response.status().is_success());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue