MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
I'm running the current public Docker image of Mock Server.
When I send a request with the following:
And having the following new.json file:
I get the following exception in Mock Server:
If I have no expectations in the server (i.e. a fresh startup), then the request simply causes a 404 response.
If I have any expectations, even if they do not match the path of the request or any other part of the request, I see the exception above.
It doesn't matter what Content-Type I provide in the request.
However, if I remove the quotes from around the values in the "parameters" object, it works:
"Works" as in there is no exception and a matching action will trigger:
This expectation, running in Node, does trigger and the callback is called. However, in the callback code I have the following:
This code causes the following problem parsing the JSON body without the quotes:
So... with quotes causes Mock Server to fail... without quotes causes Node to fail.
What's going on here?