savonrb/savon — pull request #434 by tjarratt (2013-04-17 00:09:47+00:00)
Title: Interface for savon-multipart for Savon2

After much deliberation in the comments for [issue 424](https://github.com/savonrb/savon/issues/424) I am proud to present some support in Savon 2 for the multipart-savon gem.

The motivation behind this change is to provide the savon-multipart gem a hook
so that one can use it with savon. There is little desire (or much reason) to
fix this directly in Savon since very few people will ever use it. So long as
there is a mechanism for end users of savon-multipart to specify this, it should
be easy for Savon to refactor without needing to make changes for multipart
support.

The indended use case for this would be to either configure a global or local
multipart key to :true like so:

```ruby
client = Savon::Client('http://service.example.com', :multipart => true)

# or for only a single call on a client
client.call(:some_method_returns_multipart, :multipart => true)
```

The tests here only test that we return an object that is an instance of a Savon::Multipart::Response, but does not assert on the functionality of that class. I currently have a [fork of savon-multipart with those changes](https://github.com/tjarratt/savon-multipart/tree/savon2) that might be interesting to view alongside these.

Any feedback is greatly appreciated! Many thanks for @rubiii for taking the time to read my incoherent ramblings and help design a good interface. My own regret is that it took me so long to formalize this!