Reputation: 1082
I have a post API call, which allows me to upload multiple images within form-data parameter in Postman. As you can see below, I'm sending multiple images having the key images
I wanna implement the same thing using the extension rest-client in vscode.
Upvotes: 5
Views: 4409
Reputation: 1082
Thanks to @Tomothy G.'s comment I found the solution, it looks like this:
### ---------------------------- UPLOAD FEED IMAGES ----------------------------
POST {{hostname}}/upload_feed_images
Authorization: {{token}}
Content-Type: multipart/form-data; boundary=boundary
--boundary
Content-Disposition: form-data; name="images"; filename="my_image.jpg"
Content-Type: image/jpeg
< /Users/anel-bou/Desktop/my_image.jpg
--boundary
Content-Disposition: form-data; name="images"; filename="my_image.jpg"
Content-Type: image/jpeg
< /Users/anel-bou/Desktop/my_image.jpg
--boundary--
### -------------------------------------------------------------------------
the parameter name="images"
stands for the key that the files should belong to
Upvotes: 7