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,
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. <
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs