Response body as bytearray
See original GitHub issueHi, we’re trying to introduce pact in our CI, but we’ve come to a standstill…
There’s an api that returns binary file, I’m defining the RequestResponsePath in the consumer, but there’s no method with sign body(byte[] content)
.
String is not enough because reading a binary into stream transform it in a text content.
There’s a workaround? thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Gatling2: Get response body as byte array - Stack Overflow
I want to send a request and will receive a byte[] body response. Based on this byte[] response I ...
Read more >okhttp3.ResponseBody.bytes java code examples - Tabnine
Returns the response as a byte array. This method loads entire response body into memory. If the response body is very large this...
Read more >Byte Array in REST Service response - GET method
I have a REST service which return a byte Array in the response payload. Just the byte Array , nothing else. This byte...
Read more >bytes - OkHttp
Returns the response as a byte array. This method loads entire response body into memory. If the response body is very large this...
Read more >how to get the byte array from response body directly ... - GitHub
We require that the body should be an array of bytes, but the body is a string .So how can we get the...
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 FreeTop 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
Top GitHub Comments
Hi, we ran into the same problem. application/octet-stream should work for us. Our use case doesn’t require verification of the content because producer is a pass-through although I don’t see why comparing through byte array equality shouldn’t be an option.
In my case, I would like to test a method returning a byte array. I also don’t like methods returning byte arrays as the comparison of a json response would be much better. Now I have to live with it. The possibility to use at least the byte array equality would make my life less painful 😃