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()
|
||||
.post("http://localhost:8080/login")
|
||||
.form(&[
|
||||
("username", &evt.values()["username"]),
|
||||
("password", &evt.values()["password"]),
|
||||
("username", evt.values()["username"].as_value()),
|
||||
("password", evt.values()["password"].as_value()),
|
||||
])
|
||||
.send()
|
||||
.await;
|
||||
|
||||
Reference in new issue
Block a user