How to send audio files using net/http

HI All,

I want to send audio file via http request as an api cal, not via form
using net/http. I dont want to use any other gems. Please let me know
how
can be achieved.

regards,
Loganathan
ViewMe http://vizualize.me/loganathan

HI All,

Got it working using the below script.

require ‘net/http’
require “uri”
url = “http://#{domain}:#{port}”
uri = URI.parse(url);
data = File.read(‘fil_path’) #File.read(“/usr/test.amr”)
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.body = data
request.content_type = ‘audio/amr’
res = http.request(request)
puts res.body

regards,
Loganathan
ViewMe http://vizualize.me/loganathan

On Thu, Jun 21, 2012 at 11:47 AM, Loganathan S. <