helun/Ektorp — pull request #83 by dlvenable (2012-05-15 19:44:05+00:00)
Title: Updates to support getting MIME multipart documents from HttpClient

I have some made some changes which allow a client to get a document as a MIME multipart using the HttpClient (ie. through couchDbConnector.getConnection()). This required a new get method on the HttpClient which takes an Accept header.

I also added a getRevision() method to HttpResponse since many Couch DB document calls provide a revision in the ETag. I could rename it to getETag() if you prefer it fit more closely with the HTTP response than with how Couch uses that response.

Neither of these are used in the project. I am thinking about how to add a method to CouchDBConnector to get a MIME multipart from Couch. I'm not sold on any given interface for it yet since Couch will return a JSON document if the document does not have attachments. So I've not yet added anything to CouchDBConnector.

This code allows my client to get the MIME multipart though, so I thought it would be helpful to add regardless. I'm also certain it would be the HTTP foundation for a future update to the CouchDBConnector for multiparts. Are you open to merging it in?