Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

transfer encoding chunked ruby

require 'net/http'

streamURL = 'http://localhost/sample-stream.php'

uri = URI.parse(streamURL)

Net::HTTP.start(uri.host, uri.port) do |http|
  request = Net::HTTP::Get.new uri.request_uri

  http.request request do |response|
    response.read_body do |chunk|
       #We get the data here chunk-by-chunk
       puts chunk
    end
  end
end
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #transfer #encoding #chunked #ruby
ADD COMMENT
Topic
Name
2+2 =