https://github.com/wyatt-herkamp/actix-quick-extract
https://github.com/wyatt-herkamp/actix-quick-extract
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wyatt-herkamp/actix-quick-extract
- Owner: wyatt-herkamp
- License: apache-2.0
- Created: 2023-12-20T17:21:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-06T20:26:54.000Z (6 months ago)
- Last Synced: 2024-11-19T11:01:37.500Z (5 months ago)
- Language: Rust
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Actix-Quick-Extract
Extract information from a web request easily.
## Example
```rust
#[get("/ip-addr")]
pub async fn ip_addr(ip_addr: IpAddr) -> String {
format!("Your ip_addr Header is: {}", ip_addr)
}#[get("/host")]
pub async fn host(host: Host) -> String {
format!("Your host Header is: {}", host)
}#[get("/origin")]
pub async fn origin(origin: Origin) -> String {
format!("Your Origin Header is: {}", origin)
}#[get("/accept-none-deny-bad")]
pub async fn accept_none_deny_bad(accept_none_deny_bad: AcceptNoneDenyBad) -> String {
format!("Your accept_none_deny_bad: {:?}", accept_none_deny_bad.0)
}
#[get("/origin-or-host")]
pub async fn origin_or_host(origin_or_host: OriginOrHost) -> String {
format!("Your origin or host Header is: {}", origin_or_host)
}#[get("/user-agent")]
pub async fn user_agent(user_agent: UserAgent) -> String {
format!("Your user agent Header is: {}", user_agent)
}#[get("/raw-authorization")]
pub async fn raw_authorization(auth: RawAuthorization) -> String {
format!("Your raw authorization Header is: {}", auth)
}
```