documentation/getting-started/rest/uploading-data.mdx
APIs can also be used to upload encoded content to a server. This is usually done with PUT or POST methods.
The most common content types are:
application/json: for content in JSON formatmultipart/form-data: for uploading encoded filesapplication/octet-stream: for uploading binary data directlyTo upload a file, the data you send in a POST request must be of the content types application/x-www-form-encoded and multipart/form-data.
Let's take a look at uploading an image file to an API using Hoppscotch:
POST HTTP method and set your API Endpoint URL.multipart/form-data in the content-type dropdown.choose files to select your file.The <Icon icon="pen-to-square" iconType="solid" /> Bulk Edit feature is available for multipart/form-data as well. Instead of adding or editing key-value pairs one by one, you can now manage them all at once.
multipart/form-dataWhen sending multiple types of data in a single request using multipart/form-data, you can assign a specific content type to each parameter in Hoppscotch. Here's how:
multipart/form-data from the Content Type dropdown.text/plain for plain text, image/png for a PNG image or application/json for JSON data).When uploading binary files, you may want to send raw binary data instead of files in a multipart form. This is typically done using the application/octet-stream content type. Follow these steps to upload binary data:
application/octet-stream from the Content Type dropdown.<Note> Currently, the Hoppscotch Desktop App does NOT support uploading Binary files directly as request bodies for APIs. </Note>