PUT or POST methods.
The most common content types are:
application/json: for content in JSON formatmultipart/form-data: for uploading encoded files
Uploading a file
Let us take a look at uploading an image file into an API using hoppscotch. To upload a file, the data you send in aPOST request must be of the content types application/x-www-form-encoded and multipart/form-data.
Uploading an image
- Select the
POSTHTTP method and set your API Endpoint URL. - Add the necessary headers.
- To add your image file click in the body tab and select
multipart/form-datain the content-type dropdown. - Give your file a name and click on
choose filesto select your file. - Click “Send” to upload your file.