Is it possible using post method with query parameters request matching?
See original GitHub issuevar name = "myGroup";
mockServer
.Given(Request.Create()
.WithPath("/api/v4/groups")
.WithHeader("PRIVATE-TOKEN", token)
.WithParam("name", name)
.UsingPost())
.RespondWith(Response.Create()
.WithHeader("Content-Type", "application/json")
.WithStatusCode(HttpStatusCode.Created)
.WithBody(json));
I’m implementing create group for gitlab server [doc] and trying write tests to verify some cases.
Above simple code that doesn’t work when using WithParam
as request matching .
So… Any way to verify post with query parameters?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
HTTP POST with URL query parameters -- good idea or not?
A web form can't be used to send a request to a page that uses a mix of GET and POST. If you...
Read more >REST API Design Best Practices for Parameter and Query ...
There are many ways in HTTP to add parameters to our request: the query string, the body of POST, PUT and PATCH requests,...
Read more >Matching and filtering HTTP requests in WireMock
Stub matching and verification queries can use the following request attributes: URL; HTTP Method; Query parameters; Headers; Basic authentication (a ...
Read more >Request matching - Basics - Mock Service Worker Docs
request handlers allows you to match requests by the following criteria: Request method;; Request URL. Query parameters and hashes are removed from the...
Read more >Building requests
You can send path and query parameters with your requests using the URL field and the Params tab. ... To send a query...
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
What you can do to debug, is set
AllowPartialMapping
to true in the WireMockServerSettingshttps://github.com/WireMock-Net/WireMock.Net/wiki/Settings#allowpartialmapping
When you look at the logging from the running application, you can see which elements have a score from 1.0 (=100% match)
(I just added a netcore3.1 example to this repository, that one also does work fine.)
When using 4 params (see updated code https://github.com/WireMock-Net/WireMock.Net/blob/master/examples/WireMock.Net.Console.Net452.Classic/MainApp.cs#L496) And using postman, this works fine: