question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I correctly find or ignore the ? character from a request url in the RegexMatcher used via postman, not coded.

See original GitHub issue

Latest stable wiremock version was downloaded and configured. I send messages to them via postman.

I configured a RegexMatcher, what is okay, if I do not send a ? in the url.

steps

  1. define RegexMatcher
    "Pattern": "(\/some\/service\/v1\/name)([?]{1})(param.source=SYSTEM){1}([&]{1})(param.id=123457890){1}$"
  2. do POST or PUT and configure a request / response via postman.
  3. check it with GET “__admin/mappings”
  4. send GET request to wiremock via postman. https://localhost/wiremock/some/service/v1/name?param.source=SYSTEM&param.id=123457890
  5. check response message

expected result: answer arrives correctly with defined response message

actual result: exception : "ClassName":"System.NullReferenceException","Message":"Object reference not set to an instance of an object.\

Please be specific so we can provide the best answer possible: if I not use ? in the link and change it to other character (e.g. “a-z” “0-9” + & $ ), then the same expression will work correctly

I tried ([?]{1}), ([\?]{1}) (.*{1}) ((/u003F){1}) How can I define the part from de regexp correctly ([?]{1}) to find or ignore ?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
lszlszlcommented, Nov 19, 2022

okay, thank you! That"s working fine.

0reactions
lszlszlcommented, Nov 19, 2022
{
     "Request": {
        "Path": {
            "Matchers": [
                {
                    "Name": "ExactMatcher",
                    "Pattern": "/some/service/v3/name",
                    "IgnoreCase": false
                }
            ]
        },
        "Params": [
            {
                "Name": "param.source",
                "Matchers": [
                    {
                        "Name": "ExactMatcher",
                        "Pattern": "SYSTEM"
                    }
                ]
            },
            {
                "Name": "param.id",
                "Matchers": [
                    {
                        "Name": "ExactMatcher",
                        "Pattern": "123457890"
                    }
                ]
            }
        ],
        "Methods": [
            "get"
        ]
    },
    "Response": {
        "StatusCode": "200",
        "Body": "{\"msg\":\"Hello my world!\"}",
        "Headers": {
            "Content-Type": "application/json;charset=utf-8"
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Character encoding issues in Postman (master issue) #4555
Hello everyone! Several request has been made in terms of encoding errors on get requests on Postman requests, some are old (and resolved...
Read more >
Skip request based on condition (collection) - Help
I am trying to run though my API calls yet only trigger the GET requests and save the response body to a file....
Read more >
How to handle URL with special characters present in ...
“Note: Parameters you enter in the URL bar or in the data editor will not automatically be URL-encoded. Right click a piece of...
Read more >
Find and replace regex with capturing group - Help
$1 replace the entire match with the group. When I try to search collections using the above regex, it does not find all...
Read more >
Check if an URL is valid or not using Regular Expression
Given a URL as a character string str of size N.The task is to check if the given URL is valid or not....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found