dispatch/dispatch — pull request #74 by steppenwells (2012-04-20 16:27:00+00:00)
Title: Adds the ability to add a byte array to a multipart post

Adds a couple of new <<* methods that take in a byte array as the source for the multipart file data. This complements the existing file and stream generator versions.

Setting the data from a byte array is a common use case when uploading images that have been manipulated or generated in scala code.

The ByteArrayBody used sets the Content-Length headers (similarly to the FileBody), this prevents problem when chunking large data submissions. I had problems with a squid proxy that was rejecting chunked requests when I set the data using the InputStream mechanism, using the ByteArrayBody and hence the content length data prevented this.