| Crates.io | urlcat |
| lib.rs | urlcat |
| version | 0.2.2 |
| created_at | 2023-05-03 20:29:50.158407+00 |
| updated_at | 2023-05-04 10:23:52.392744+00 |
| description | a simple tool to help easily generate dynamic urls with proper encoding |
| homepage | |
| repository | https://github.com/Tronikelis/urlcat-rs |
| max_upload_size | |
| id | 855912 |
| size | 45,242 |
This package urlbat rewritten in rust
use std::collections::HashMap;
use urlcat::urlcat;
fn main() {
let url = urlcat(
"https://example.com/",
"path/:crab/resource",
HashMap::from([
("pretty", "cool/+/& yep".to_string()),
("really", "cool/+/& probably".to_string()),
("crab", "🦀".to_string()),
]);
);
assert_eq!(
url,
"https://example.com/path/🦀 well actually (%F0%9F%A6%80)/resource?pretty=cool%2F%2B%2F%26+yep&really=cool%2F%2B%2F%26+probably"
);
}