如何在VSCODE中使用REST-CLIENT上传多个文件

发布于 2025-02-03 08:04:36 字数 418 浏览 1 评论 0原文

我有一个API呼叫,它使我可以在Postman中的Form-Data参数中上传多个图像。如下所示,我要发送多个图像,其中包含键images

“在此处输入图像说明”

我想使用扩展名 rest-client 在VSCODE中。

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

enter image description here

I wanna implement the same thing using the extension rest-client in vscode.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

分开我的手 2025-02-10 08:04:36

多亏了@Tomothy G.的评论,我找到了解决方案,看起来像:

### ---------------------------- 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--
### -------------------------------------------------------------------------

参数name =“ images”代表文件应属于的密钥

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文