Getting CookieJar
from headers in tests
#2020
-
Bug ReportVersionaxum = { version = "0.6.18", features = ["macros", "headers"] } Platform64-bit (Windows 10) CratesDescription
I tried this code: let client = hyper::Client::new();
let json_bytes = serde_json::to_vec(&json!({}))
.unwrap();
let request = Request::builder()
.uri("/")
.method("POST")
.header("Content-Type", "application/json")
.body(Body::from(json_bytes))
.unwrap();
let response = client
.request(request)
.await.unwrap();
let cookies = CookieJar::from_headers(response.headers());
dbg!(&cookies); I expected to see this happen: Instead, this happened:
|
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
May 25, 2023
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
aalowlevel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CookieJar
only supports cookies from requests (Cookie
headers). Not cookies from responses (Set-Cookie
)