Skip to content

Instantly share code, notes, and snippets.

@glennblock
Forked from mamund/attach-template.js
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glennblock/8836898 to your computer and use it in GitHub Desktop.
Save glennblock/8836898 to your computer and use it in GitHub Desktop.
// cj write template
{
"template" : {
"data" : [
{"name" : "qwe", "value" : ""},
{"name" : "rty", "type" : "part"}
]
}
}
Content-type: multipart/form-data, boundary=AaB03x
--AaB03x
content-disposition: form-data; name="document"
Content-Type: application/vnd.collection+json
{ "template": {
"data": [
{ "name": "qwe", "value": "some text" }
{ "name": "image", "value": "rty", "type": "part" }
]
}
--AaB03x
Content-disposition: attachment; name="rty"; filename="portrait.tiff"
Content-type: image/tiff
Content-Transfer-Encoding: binary
...contents...
--AaB03x--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment