Match request body for PUT and POST requests
See original GitHub issueHello!
I started to use this library since I switched my work from Angular to React and axios for http-requests. Thank you for this package, that was really a missing feature.
Now I have a lack of matching body for requests with payload. I’d like to do something like this:
mock.onPost('/api/users', {name: 'new user', email: 'test@email.com'}).reply(200);
Then I can to test not only that request was actually called, but also that it has proper body. That feature was built-in in Angular’s mock library, so it would be nice to have it there as well.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Are PUT and POST requests required/expected to have a ...
Both POST and PUT include the phrase entity enclosed in the request. Based on my reading, I believe that a body is desired...
Read more >Request Matching - WireMock
Request body ; Multipart/form-data. Here's an example showing all attributes being matched using WireMock's in-built match operators. It is also possible to ...
Read more >The best way to add a Request Body to a POST request using ...
It's in different ways and one is unanimous: the use of either String or HashMap in the requests. The intention here is to...
Read more >HTTP Request Methods – Get vs Put vs Post Explained with ...
We use POST to create a new resource. A POST request requires a body in which you define the data of the entity...
Read more >Matching POST request BODY - Just getting started - Postman
I am using mock-server to test post and get requests. I have created various examples for a get request that match with the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I can try and write a PR for this if wanted. @ctimmerm are you okay with having a dependency for a deep equal library like https://github.com/chaijs/deep-eql to implement this Feature or is there an easier way?
@ludovicthomas Still doesn’t work for me. Return 404.