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.

Response body as bytearray

See original GitHub issue

Hi, 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:open
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
verkhorocommented, Feb 5, 2018

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.

0reactions
IraRecommented, Nov 26, 2018

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 😃

Read more comments on GitHub >

github_iconTop 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 >

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