urlcat

Crates.iourlcat
lib.rsurlcat
version0.2.2
sourcesrc
created_at2023-05-03 20:29:50.158407
updated_at2023-05-04 10:23:52.392744
descriptiona simple tool to help easily generate dynamic urls with proper encoding
homepage
repositoryhttps://github.com/Tronikelis/urlcat-rs
max_upload_size
id855912
size45,242
Donatas (Tronikelis)

documentation

README

urlcat

Inspired by urlcat

What is this?

This package urlbat rewritten in rust

Features

  • sorts the querystring
  • correctly escapes values

Simple example showing what it can do

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"
    );
}
Commit count: 18

cargo fmt