fix: Use as_value() to properly serialize form values in login example (#3835)
The login form example was trying to directly use FormValue in reqwest's form method, which doesn't implement Serialize. This change extracts the actual string values using as_value() before sending them to the server.
This commit is contained in:
1 parent
fd65c12bf5
commit
487fa25dc8
1 file changed
+2
-2
@@ -17,8 +17,8 @@ fn app() -> Element {
|
|||||||
let resp = reqwest::Client::new()
|
let resp = reqwest::Client::new()
|
||||||
.post("http://localhost:8080/login")
|
.post("http://localhost:8080/login")
|
||||||
.form(&[
|
.form(&[
|
||||||
("username", &evt.values()["username"]),
|
("username", evt.values()["username"].as_value()),
|
||||||
("password", &evt.values()["password"]),
|
("password", evt.values()["password"].as_value()),
|
||||||
])
|
])
|
||||||
.send()
|
.send()
|
||||||
.await;
|
.await;
|
||||||
|
|||||||
Reference in new issue
Block a user