Allow passing http request headers with custom character capitalization.

This helps sending valid headers for SOAP requests.
Allow creating attachments on unsaved documents.

Saving the attachments reference inside the document body would still fail
because cannot predict the doc_id.
Turns out that multipart document saves works only for updates not
for creating new documents. Adjust the api calls accordingly.
Merge branch 'master' into release-0.25.x