Skip to content

Instantly share code, notes, and snippets.

@zdne
Last active March 25, 2021 03:44
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdne/6267785 to your computer and use it in GitHub Desktop.
Save zdne/6267785 to your computer and use it in GitHub Desktop.
API Blueprint multipart request example. Raw HTTP source: http://chxo.com/be2/20050724_93bf.html.
# POST /path/to/script.php
+ Request (multipart/form-data, boundary=AaB03x)
+ Headers
Content-Length: $requestlen
+ Body
--AaB03x
content-disposition: form-data; name="field1"
$field1
--AaB03x
content-disposition: form-data; name="field2"
$field2
--AaB03x
content-disposition: form-data; name="userfile"; filename="$filename"
Content-Type: $mimetype
Content-Transfer-Encoding: binary
$binarydata
--AaB03x--
+ Response 201 (text/plain)
Ok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment