Closed ahl closed 1 year ago
Hi @ahl ! Thanks for creating this issue. Do you think matches
would be sufficient for you?
I see! So something like this:
when.matches(|req| {
req.query_params
.as_ref()
.and_then(|qs| qs.iter().find(|(key, _)| key == "x"))
.is_none()
});
That works; thanks. Feel free to close this
Hi, wasn't sure if should open another issue, but related to this exact request: Would it still make sense to add such criterion for query_params and headers given that matches does not work for remote mock servers?
Thanks in advance!
First: love this crate. Thank you.
I have a situation where I want a server with two similar mocks: one where a particular query parameter is set; another where it is not. I can make it work by specifying the query-set mock first, but that ordering feels a little fragile. I would love it if there were a way to do something like this:
If you'd be amenable, I'd be happy to submit a PR for this functionality.