-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
When using server functions with the web
crate feature, query parameter mapping for #[get]
routes does not work.
Example:
#[get("/api/param_echo?input")]
async fn param_echo(input: String) -> Result<String, ServerFnError> {
Ok(input)
}
The input
parameter is not passed from the frontend — the server receives no query parameters and returns HTTP 400.
If the same endpoint is invoked manually (e.g., with curl
or directly in the browser, including the query parameter), everything works correctly, which indicates that the browser part is not attaching the query param properly.
Steps To Reproduce
Steps to reproduce the behavior:
- Clone the reproduction repo: https://github.com/bwskin/serverfn_get_param_reproduce
cd serverfn_get_param_reproduce && dx serve
- Open the app in the browser and type some text into input, triggering echo server function.
- Observe that the request returns 400 Bad Request.
- Invoke the same endpoint manually (e.g.,
curl http://127.0.0.1:8080/api/param_echo?input=test
) — it works as expected.
Expected behavior
The input
query parameter should be sent from the frontend to the server, allowing the server function to receive it correctly.
Environment:
- Dioxus version:
v0.7.0-rc.3
/main (321032c)
- Rust version:
1.92.0-nightly
- App platform:
web
Questionnaire
I would like to fix and I have a solution (#4827).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working