Created
February 6, 2014 01:21
-
-
Save mamund/8836781 to your computer and use it in GitHub Desktop.
possible cj extension to support uploads. if "file" property appears in the "template" object then client SHOULD use multipart/form-data for sending the request body.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cj write template | |
{ | |
"template" : { | |
"data" : [ | |
{"name" : "qwe", "value" : ""}, | |
{"name" : "rty", "file" : ""} | |
] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "my picture" } | |
] | |
} | |
--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