0

I have been using Grape for Restful api requests for our Ruby on rails application. I have a requirement of doing an audio attachment for my blogs.

What is the best way of sending an attachment to my API requests.

How to convert an audio attachment to bytearray.

3
  • Hi, not a ruby expert but, with REST, you can pass "object" data (as json) with a POST request. Technically, in REST terms, a POST request should be reserved for passing new data or writing data to the server through a write API. Not sure if that fits your use case. Nevertheless, as a starter for ten, here's a link that might help Commented Mar 4, 2013 at 8:06
  • Hi, i am using Grape for sending API requests. For images i am sending the encoded base64 strings and doing the paperclip attachment from rails side. For audio attachments i am thinking to send a byte array of audio which from rails side i will save it. But dont know how to get a byte array of an audio ? Commented Mar 4, 2013 at 8:10
  • Ok, have you checked out these two posts that seem to be relevant? record-audio-streaming-with-ruby-on-rails and ruby-how-to-represent-message-length-as-2-binary-bytes. Commented Mar 4, 2013 at 9:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.