Forum Discussion

rahul_phadnis's avatar
rahul_phadnis
Occasional Contributor
14 years ago

Send Binary Data in REST Request

I am looking for a way to send a Protocol Buffer request using a REST Request. The content type for the request is application/x-protobuf. I have written a groovy script that creates a byte array representing the request. My question is how do I set the request body to this byte array ?

Looking at the general properties API, I see that they all work on strings and I don't see a way to set a property value to a byte array. Is there a way to set the request body content ? (You can do this using property expansion for only strings)

Thank you,

Rahul

3 Replies

  • Hi, I am having the same question, because I need to send compressed/binary data instead of human-readable xml as the content of my POST request.
    Unfortunately there is no answer yet to this old posting. But I hope that someone will answer now when I bring this up again.
    Many thanks in advance!
  • Hi,

    I get exactly the same problem with you. Did you have your answer? Could you please share the solution for everyone?

    Regards,

    Sam
    • maarten's avatar
      maarten
      Occasional Contributor

      I have the same issue, anyone managed a way to do this?