Four body format for POST
format-data
multipart/form-data, it can upload multiple key-values and files.
1 | // axios simple sample |
x-www-form-urlencoded
application/x-www-from-urlencoded, it converts data to key-values and cannot upload files.
raw
It can upload text in any format. We always upload JSON data in this way.
content-type | Note |
---|---|
text/plain | Text |
application/javascript | JavaScript |
application/json | JSON |
text/html | HTML |
application/xml | XML |
binary
application/octet-stream, only binary data can be upload, usually used to upload files. Because it is not key-value format, only one data can be passed at once.