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:
- PHP - http://docs.php-http.org/en/latest/
- Python - https://toolbelt.readthedocs.io/en/latest/
- Haskell - Servant or Wreq