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:
Varun V authored and GitHub committed 2025-04-15 14:34:20 -07:00
1 parent fd65c12bf5
commit 487fa25dc8
1 file changed
+2 -2
+2 -2
View File
@@ -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;