toamitkumar / ruby-multipart-post

Multipart Form Post through ruby script
9 stars 3 forks source link

= ruby-multipart-post

== DESCRIPTION

Multipart form post thru Ruby script, headers content-type and content-length properly set

== SYNOPSIS

require 'ruby-multipart-post'

params = { "param_0" => "value_0", "param_1" => "value_1", "file_0" => FileUploadIO.new(path_to_file, file_content_type), "file_1" => FileUploadIO.new(path_to_file, file_content_type) }

file_content_type is the file content_type eg: "image/jpeg"

it now supports https url as well

multipart_post = MultiPart::Post.new(params) # MultiPart::Post.new(params, some_extra_headers) multipart_post.submit(to_url) # multipart_post.submit(to_url, query_string)

== REQUIREMENTS

None

==Ruby Version compatibility Tested against -> REE, Ruby MRI (1.8.x, 1.9.2)

== INSTALL

gem install ruby-multipart-post

== LICENSE:

(The MIT License)

Copyright (c) 2010-2011 Amit Kumar toamitkumar@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.