hyperium / http

Rust HTTP types
Apache License 2.0
1.15k stars 285 forks source link

Make it easier to mutate query parameters in `Uri` #577

Open jdisanti opened 1 year ago

jdisanti commented 1 year ago

In the AWS SDK, we needed to insert query parameters in an existing Uri for our presigning implementation. There wasn't an easy way to do this in http, so we ended up writing the following QueryWriter:

https://github.com/awslabs/smithy-rs/blob/a0539e20b069a7de021c84521d8f3c7ba098ad6d/aws/rust-runtime/aws-sigv4/src/http_request/query_writer.rs#L9-L73

It would be nice to have built-in utilities for manipulating URI components either in this crate, or in a separate related utility crate.

seanmonstar commented 1 year ago

It would be nice to make that easier. I know one of the hopes for the uri::Builder was to make it easier to modify various parts, I wonder if that would be the best place to do so? #206