简体   繁体   English

Postman 与“正文”(json)和文件(多部分)一起在 1 个 restful 请求中

[英]Postman with "body" (json) and files (multipart) together in 1 restful request

How do I use Postman to send queries with body (in json format) and files (in multipart) format at the same time?如何使用 Postman 同时发送正文(json 格式)和文件(多部分)格式的查询?

I think I should use Postman->Body->Raw although I can't find an example on the Web. Anyone can kindly teach me?我想我应该使用 Postman->Body->Raw,虽然我在 Web 上找不到例子。有人可以教我吗? Thank you!谢谢!

In postman, set method type to POST .在 postman 中,将方法类型设置为POST

Then select Body -> form-data -> Enter your parameter name ( file according to your code)然后 select Body -> form-data -> Enter your parameter name ( file according to your code)

On the right side of the Key field, while hovering your mouse over it, there is a dropdown menu to select between Text/File .在 Key 字段的右侧,将鼠标悬停在它上面时,在Text/File之间有一个指向 select 的下拉菜单 Select File, then a "Select Files" button will appear in the Value field. Select 文件,然后“选择文件”按钮将出现在“值”字段中。

For rest of JSON data , you can click on raw and enter your JSON data there.对于 JSON数据中的 rest,您可以单击原始数据并在那里输入您的 JSON 数据。

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 json 正文和多部分文件数组的 PUT 请求 - PUT request with json Body and multipart files array Python 请求模拟 CURL POST 发送带有 1 个或多个文件和 JSON 正文的多部分请求 - Python Requests Emulate a CURL POST sending multipart request with 1 or more files AND JSON body 如何在 Spring 引导中通过 REST API 使用请求正文(JSON)以及多个文件(多部分/表单数据)? - How to consume Request Body (JSON) along with multiple files (multipart/form-data) via REST API in Spring Boot? 如何形成 http 请求主体的 protobuf 资源部分并通过 dhc 客户端或 postman 测试它以获得宁静的服务 - How to form protobuf resource part of http request body and test it through dhc client or postman for restful services 将正文请求POST中的多个文件上传到Spring Restful API - Upload multiple files in body request POST to Spring Restful API GET请求主体中的RESTful Web服务和JSON文档 - RESTful web services and JSON document in GET request body 消费将JSON对象作为请求主体传递的RESTful WebService - Consuming a RESTful WebService passing a JSON object as request body 当前请求不是多部分请求 Spring Boot 和 Postman (Uploading json file plus extra field) - Current request is not a multipart request Spring Boot and Postman (Uploading json file plus extra field) 如何在邮递员的同一请求中发送多部分/表单数据和嵌套的json? - How to send multipart/form-data and nested json in the same request in postman? 如何在 postman 多部分/表单数据发布请求中将应用程序/json 数据与文件一起发送? - How to send application/json data along with file in postman multipart/form-data post request?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM