ureq icon indicating copy to clipboard operation
ureq copied to clipboard

feat: Set multi query parameters

Open zu1k opened this issue 3 years ago • 2 comments

Add a query_vec function for setting multi query parameters. To avoid repeated deserialization and serialization.

Signed-off-by: zu1k [email protected]

zu1k avatar May 19 '22 09:05 zu1k

Hi! Thanks for this! If we are to add this, I think the API should avoid Vec, and be:

 pub fn query_pairs(mut self, pairs: &[(&str, &str)]) -> Self {

or it could go all the way generic, but we generally have avoided "complicated" trait bounds in other contexts.

 pub fn query_pairs(mut self, pairs: impl IntoIter<(&str, &str)>) -> Self {

@jsha how do you feel about this API addition?

algesten avatar May 22 '22 09:05 algesten

I think this looks good. Unless @jsha objects, we can merge it.

algesten avatar May 22 '22 11:05 algesten

Late to the party, but his looks great to me!

jsha avatar Dec 04 '22 18:12 jsha