Groups
Groups
Sign in
Groups
Groups
wiremock-user
Conversations
About
Send feedback
Help
How to tell wiremock to ignore query strings parameters in mapping file
8,345 views
Skip to first unread message
Ricardo Mayerhofer
unread,
Jun 7, 2015, 11:24:19 AM
6/7/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wiremo...@googlegroups.com
Hello all!
Currently I have the following configuration file in my mapping folder:
{
"request": {
"method": "GET",
"url": "/myurl"
},
"response": {
"status": 200,
"bodyFileName": "contacts.json"
}
}
What I'm facing is that any query parameter appended in the request URL breaks my mock, so a call to
http://mockurl/myurl?query=string
gives me a 404.
Is there a way to tell wiremock to ignore query parameters when mapping mock URLs?
Thanks.
Tom Akehurst
unread,
Jun 7, 2015, 11:35:16 AM
6/7/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wiremo...@googlegroups.com, ricar...@gmail.com
Easiest way is probably to use a regex:
"urlPattern":"/myurl\?.*"
Ricardo Mayerhofer
unread,
Jun 13, 2015, 6:23:19 PM
6/13/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wiremo...@googlegroups.com, ricar...@gmail.com
Works like charm. Thanks Tom.
Reply all
Reply to author
Forward
0 new messages