httptest
httptest copied to clipboard
support matching by query string
/foobar
matches /foobar?file_type=zip
while /foobar?file_type=zip
fails to match /foobar?file_type=zip
Sorry, I'm not sure I understand what exactly matches or doesn't match here. Would you mind posting a snippet of code that identifies what's expected and isn't working? Thanks.
@dzmitry-lahoda there is a separate matcher for matching the query I fell into the same hole because the README doesn't show you that there is a separate matcher for this, you can find it in the source code though
Your example would look something like this
server.expect(
Expectation::matching(all_of![
request::method("GET"),
request::path("/foobar"),
request::query("file_type=zip"),
])
.respond_with(json_encoded(json!({"result": "success"}))),
);