Last active
August 29, 2015 14:03
-
-
Save myndzi/75bd45ef8b88ff3467e4 to your computer and use it in GitHub Desktop.
Multipart/form-data POST
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
HTML: | |
<form action="/api/thing" method="post" enctype="multipart/form-data"> | |
<input name="caption"> | |
<input type="file" name="file"> | |
<input type="submit" value="Submit"> | |
</form> | |
Request: | |
POST /api/thing HTTP/1.1 | |
Content-Type: multipart/form-data; boundary=--foo | |
Content-Length: 12345 | |
--foo | |
Content-Disposition: form-data; name="caption" | |
Summer vacation | |
--foo | |
Content-Disposition: form-data; name="image1"; filename="GrandCanyon.jpg" | |
Content-Type: image/jpeg | |
(Binary data) | |
--foo-- |
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
POST /api/thing HTTP/1.1 | |
Content-Type: multipart/form-data; boundary=--foo | |
Content-Length: 12345 | |
--foo | |
Content-Disposition: form-data; name="FooModel" | |
Content-Type: application/json | |
{"json":"data"} | |
--foo | |
Content-Disposition: form-data; name="BarModel" | |
Content-Type: application/json | |
{"json":"data"} | |
--foo-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment