I'm having difficulty finding any sort of module or documentation on making multipart/mixed requests. Note this is not for sending an email--I'm trying to use the Google Drive v3 REST API, specifically the batch request (see below).
There is an non-Perl "example" given by Google on the Batching Requests page:
POST https://www.googleapis.com/batch Accept-Encoding: gzip User-Agent: Google-HTTP-Java-Client/1.20.0 (gzip) Content-Type: multipart/mixed; boundary=END_OF_PART Content-Length: 963--END_OF_PART Content-Length: 337 Content-Type: application/http content-id: 1 content-transfer-encoding: binary
POST https://www.googleapis.com/drive/v3/files/<var class="apiparam">fileId</var>/permissions?fields=id Authorization: Bearer <var class="apiparam">authorization_token</var> Content-Length: 70 Content-Type: application/json; charset=UTF-8
{ "emailAddress":"example@appsrocks.com", "role":"writer", "type":"user" } --END_OF_PART Content-Length: 353 Content-Type: application/http content-id: 2 content-transfer-encoding: binary
POST https://www.googleapis.com/drive/v3/files/<var class="apiparam">fileId</var>/permissions?fields=id&sendNotificationEmail=false Authorization: Bearer <var class="apiparam">authorization_token</var> Content-Length: 58 Content-Type: application/json; charset=UTF-8
{ "domain":"appsrocks.com", "role":"reader", "type":"domain" } --END_OF_PART--
For example, I want to be able to use these specific calls to update/delete a permission (using PATCH or DELETE semantics) using batch requests:
P.S. does anyone know if some key-value pairs can be unspecified--Content-Length, for example, in the above request
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |