Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hd1801/c4623a6a36af7ddb12d79f62fd9d71ea to your computer and use it in GitHub Desktop.
Save hd1801/c4623a6a36af7ddb12d79f62fd9d71ea to your computer and use it in GitHub Desktop.
Multi-file Content-Type for HTTP APIs

Multi-file Content-Type for HTTP APIs

Sometimes you need to send a combination of key-value data and also file data in 1 single atomic request or response.

Use multipart/form-data for both requests and responses. Prefer this over using application/x-tar format.

Multipart actually has multiple subtypes. But the only one supported by HTTP clients and servers is multipart/form-data.

Libraries:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment