Comments (6)
req.query()
returns hash map of references, in most cases it does not copy data,
that is why borrows req
. so you have to extract query() parameter and convert it to String, then you should be able to use payload.
something like:
let param = req.query().get("token").unwrap().to_owned();
I am not sure about req.query()
api yet. maybe it should return owned string
from actix-web.
other option is something like "query extractor" similar to Params
type
from actix-web.
my quickly solution
use url::{form_urlencoded};
...
for (key, val) in form_urlencoded::parse(req.query_string().as_ref()) {
println!("{} => {}", key, val);
}
Thanks
from actix-web.
I'll make this api more friendly later today
from actix-web.
I change query()
api, it should more user friendly now
https://actix.github.io/actix-web/actix_web/struct.HttpRequest.html#method.query
from actix-web.
Thank you, that's great.
from actix-web.
Related Issues (20)
- Setting the path_filter and show_files_listing, but list page still show all files. HOT 2
- Support `.cookie(...)` for `customize()` HOT 7
- Call for help with bind_rustls_021 just support one request at the same time HOT 6
- default service not defaulting to the parent scope
- Pending multipart request with angular rxjs HOT 1
- **I want to send the bytes of the playload to the LOG server in the log middleware** HOT 1
- actix-http 3.5 "Prevent compression of zero-sized response bodies" causes delays to close connection HOT 2
- The function app_data of web::ServiceConfig cannot persist HOT 1
- actix-files: Can't handle files with newlines in them
- websocket bug!Cannot complete one websocket client to send a message to another client
- Why is the code below why version 4 cannot access httpserver, but version 3 can? HOT 1
- awc CONNECT method support
- add Proxy-Connection header HOT 3
- Filter out completely impossible characters.
- Add macro for route handler accepting all HTTP methods HOT 13
- Compilation fails when using the latest version of rustls HOT 5
- Add pattern syntax for optional trailing slash
- [How to] Middleware `Response body` manipulation.
- Add support to be able to test the route tree using `match_pattern` and `match_name`. HOT 2
- Connecting to the database from an external network causes a spike in connections HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from actix-web.