我正在使用 Postman Chrome 扩展程序来测试网络服务.
I am using the Postman Chrome extension for testing a web service.
提供了三个数据输入选项.
There are three options available for data input.
我猜 raw 用于发送 JSON.
I guess the raw is for sending JSON.
另外两个form-data和x-www-form-urlencoded有什么区别?
What is the difference between the other two, form-data and x-www-form-urlencoded?
推荐答案这些是 W3C 定义的不同表单内容类型.如果您想发送简单的文本/ASCII 数据,则 x-www-form-urlencoded 将起作用.这是默认设置.
These are different Form content types defined by W3C. If you want to send simple text/ ASCII data, then x-www-form-urlencoded will work. This is the default.
但是,如果您必须发送非 ASCII 文本或大型二进制数据,form-data 就是为此.
But if you have to send non-ASCII text or large binary data, the form-data is for that.
如果您想发送纯文本或 JSON 或任何其他类型的字符串,您可以使用 Raw.顾名思义,Postman 会按原样发送您的原始字符串数据,无需修改.可以使用下拉列表中的内容类型标头设置您发送的数据类型.
You can use Raw if you want to send plain text or JSON or any other kind of string. Like the name suggests, Postman sends your raw string data as it is without modifications. The type of data that you are sending can be set by using the content-type header from the drop down.
Binary 可用于将非文本数据附加到请求中,例如视频/音频文件、图像或任何其他二进制数据文件.
Binary can be used when you want to attach non-textual data to the request, e.g. a video/audio file, images, or any other binary data file.
请参阅此链接以进一步阅读:HTML 文档中的表单
Refer to this link for further reading: Forms in HTML documents
更多推荐
Postman Chrome:form
发布评论