Postman Chrome:表单数据,x-www-form-urlencoded和原始数据之间有什么区别 [英] Postman Chrome: What is the difference between form-data, x-www-form-urlencoded and raw

查看:583
本文介绍了Postman Chrome:表单数据,x-www-form-urlencoded和原始数据之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Postman Chrome扩展程序来测试Web服务。

I am using the Postman Chrome extension for testing a web service.

数据输入有三个选项。

我想 raw 是用于发送JSON的。

I guess the raw is for sending JSON.

其他两个有什么区别,表单数据 x-www-form-urlencoded

What is the difference between the other two, form-data and x-www-form-urlencoded?

推荐答案

这些是W3C定义的不同的Form内容类型。
如果您要发送简单的文本/ 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会按原样发送您的原始字符串数据,而无需进行任何修改。可以使用下拉菜单中的content-type标头设置要发送的数据类型。

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 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:表单数据,x-www-form-urlencoded和原始数据之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆