http-rs / surf

Fast and friendly HTTP client framework for async Rust
https://docs.rs/surf
Apache License 2.0
1.45k stars 119 forks source link

RequestBuilder: add .query() #246

Closed Fishrock123 closed 3 years ago

Fishrock123 commented 3 years ago

This was missing form the original RequestBuilder. My bad.

This would be very handy for me, so I'm pretty eager to get it in asap.

jbr commented 3 years ago

Side note: In reading through this, I ran into this (somewhat-unrelated) line: https://github.com/http-rs/surf/blob/main/src/request.rs#L129 — any idea what's going on there? we've already mutated the url, why are we cloning it?

Fishrock123 commented 3 years ago

Huh. Good question. b6113dec3df05995dc4d5506c4dd81db4a3e7d9b is the answer but I can't think why I left that stuff.

I've removed serde_urlencoded entirely in favor of just using http-types' querystring impl (which uses serde_qs).