tomakehurst/wiremock — pull request #127 by purebill (2014-04-16 12:20:13+00:00)
Title: Added ability to record binary equal request bodies

Hi guys,

I'm using WireMock to mock Hessian service. Also I'm recording mappings using WireMock built-in ability to proxy not mocked yet requests to the real service and then save them as mappings.

I've found that this approach does not work for Hessian as it sends binary data in the request body and does not specify content encoding. So "iso-8859-1" encoding is used to convert this request body to string (as WireMock uses strings to match requests) and some raw request body bytes are not interpreted well.

As a result WireMock records bad request bodies and also send this bad requests to the proxied Hessian service, which does not understand the request and responses with fail.

So, I've decided to extend WireMock's value matching strategies by adding binary matching (equalToByteArray) matching strategy.

Feel free to point me a better way to implement this as I'm new to this code base.

Thank you,
ILYA Sedlovsky