Skip to content

Instantly share code, notes, and snippets.

@pete
Forked from prem/gist:14688
Created October 4, 2008 01:17
Show Gist options
  • Save pete/14690 to your computer and use it in GitHub Desktop.
Save pete/14690 to your computer and use it in GitHub Desktop.
require 'net/http'
urls = %w(
http://irvsrdves3.flight.yellowpages.com:8080/smm/ypc?field=city_state_business&imei=353763.01541827.6&grammar=/data1/lm/test.lm
http://research.yellowpages.com:8080/smm/ypc?field=city_state_business&imei=353763.01541827.6&grammar=/data1/lm/test.lm
)
urls.each { |url|
puts url
uri = URI.parse url
request = Net::HTTP::Post.new(uri.path)
request.body = File.read("/tmp/test.amr")
request.content_type = 'audio/amr'
response = Net::HTTP.new(uri.host, uri.port).start { |http|
http.request(request)
}
puts response.inspect
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment