Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to upload video file with httparty

hi I have seen httparty but I don't have a idea to how to implement there are many example of model file but which paramater can be use for upload the video file

like image 600
hardik9045 Avatar asked Feb 28 '11 11:02

hardik9045


1 Answers

HTTMultiParty supports file uploads by posting a multipart MIME document. It wraps HTTParty so you use it in the same way. For the file, just supply a File object. Example from the README:

require 'httmultiparty'
class SomeClient
  include HTTMultiParty
  base_uri 'http://localhost:3000'
end

response = SomeClient.post('/', :query => {
  :foo      => 'bar',
  :somefile => File.new('README.md')
})
like image 183
Mark Thomas Avatar answered Sep 19 '22 04:09

Mark Thomas