Sending multipart/mixed content with curl

Is there a way to transfer a body encoded as multipart/mixed with curl?

Background: I'm trying to carry out batch requests with Azure table storage, and it requires that the individual transactions within a batch be encoded as a (nested!) multipart/mixed body.

Here's the example request body from the linked page. It would be great if I could get something like this using curl/httr, rather than having to build it by hand.

--batch_a1e9d677-b28b-435e-a89e-87e6a768a431  
Content-Type: multipart/mixed; boundary=changeset_8a28b620-b4bb-458c-a177-0959fb14c977  
  
--changeset_8a28b620-b4bb-458c-a177-0959fb14c977  
Content-Type: application/http  
Content-Transfer-Encoding: binary  
  
POST https://myaccount.table.core.windows.net/Blogs HTTP/1.1  
Content-Type: application/json  
Accept: application/json;odata=minimalmetadata  
Prefer: return-no-content  
DataServiceVersion: 3.0;  
  
{"PartitionKey":"Channel_19", "RowKey":"1", "Rating":9, "Text":".NET..."}  
--changeset_8a28b620-b4bb-458c-a177-0959fb14c977  
Content-Type: application/http  
Content-Transfer-Encoding: binary  
  
POST https://myaccount.table.core.windows.net/Blogs HTTP/1.1  
Content-Type: application/json  
Accept: application/json;odata=minimalmetadata  
Prefer: return-no-content  
DataServiceVersion: 3.0;  
  
{"PartitionKey":"Channel_17", "RowKey":"2", "Rating":9, "Text":"Azure..."}  
--changeset_8a28b620-b4bb-458c-a177-0959fb14c977  
Content-Type: application/http  
Content-Transfer-Encoding: binary  
  
MERGE https://myaccount.table.core.windows.net/Blogs(PartitionKey='Channel_17', RowKey='3') HTTP/1.1  
Content-Type: application/json  
Accept: application/json;odata=minimalmetadata  
DataServiceVersion: 3.0;  
  
{"PartitionKey":"Channel_19", "RowKey":"3", "Rating":9, "Text":"PDC 2008..."}  
  
--changeset_8a28b620-b4bb-458c-a177-0959fb14c977--  
--batch_a1e9d677-b28b-435e-a89e-87e6a768a431  

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.