Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

HTTMultiParty is a thin wrapper around HTTParty to provide multipart uploads.

tree: 1d1d31a943

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

Description

HTTMultiParty is a thin wrapper around HTTParty to provide multipart uploads.

Requirements

  • httparty
  • multipart-post

O RLY?

To start just "include HTTMultiParty" instead of "include HTTParty" into your client class. When you pass a query with an instance of a File as a value for a PUT or POST request, the wrapper will use a bit of magic and multipart-post to execute a multipart upload:

Example

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

response = SomeClient.post('/', :query => {
    :foo      => 'bar',
    :somefile => File.new('README.md')
  })
Something went wrong with that request. Please try again.