New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stub GET (or POST) params in different order #101
Comments
👍 I realize that this issue is super old, but I would appreciate this feature :) |
Hi, It's not documented but Nocilla is pretty extensible. In the DSL, both the expected URL and the expected body, expect an All you have to do is create an object that conforms to that protocol and has the logic that you wish to implement and pass that object to the DSL. For instance you could do: stubRequest(@"GET", matchingUrl(@"http://foo.com").withQuery(@{"abc": @"123"}))
.withBody(matchingJson(@{"fgh":@"666")) Your functions And Nocilla is internally implemented using Play with it, let me know if you have any questions and contribute back if you feel like it. |
Thanks @luisobo. I think I'll look into this! |
Hi,
I'm trying to stub a request with Nocilla, and I'm not sure that with regex should be enough to define path structure.
I mean, when you send GET or POST params, you don't need to send these params in any order, so regex isn't the same for
GET: http://api.myhost.com/users?pagination=5&per_page=10
than forGET: http://api.myhost.com/users?per_page=10&pagination=5
, but API response should be the same.Should be interesting to have a dictionary with GET/POST params instead of a NSString and iterate over it instead of match exactly? If your answer is yes, I could start to work in my first PR to Nocilla :)
What do you think about that?
The text was updated successfully, but these errors were encountered: