You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, first of all, thanks for the great library. We found an issue with query_param. According to the documentation, it's not necessary to encode the query value.
Sets a query parameter that needs to be provided.
Attention!: The request query keys and values are implicitly allowed, but is not required to be urlencoded! The value you pass here, however, must be in plain text (i.e. not encoded)!
In order to match, we need to replace spaces with +. I'd expect that this library can handle it for me so I don't need to care about encoding internals.
let m = server.mock(|when, then|{
when.query_param("query","Metallica is cool".replace(" ","+"));
then.status(200);});let req = hyper::Request::builder().method(Method::GET).uri(Url::parse_with_params("http://example.com/",&[("query","Metallica is cool")],).unwrap().to_string(),).header("content-type","application/json").body(Body::empty()).unwrap();
The text was updated successfully, but these errors were encountered:
Hi @StarpTech, thanks fur submitting this issue.httpmock uses qstring to convert query strings into key/value pairs (see here). It seems that it doesn't handle that situation correctly as it only treats %20 as a space but not +.
It seems to be a known open issue in qstring though: algesten/qstring#3. The library seems unmaintained, so it might be a candidate for a replacement in future.
Hi, first of all, thanks for the great library. We found an issue with
query_param
. According to the documentation, it's not necessary to encode the query value.In order to match, we need to replace spaces with
+
. I'd expect that this library can handle it for me so I don't need to care about encoding internals.Reference: https://url.spec.whatwg.org/#url-parsing (spaceAsPlus)
The text was updated successfully, but these errors were encountered: