查看 jQuery 传输的内容 POST 数据

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1350779/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 11:16:26  来源:igfitidea点击:

To see the content POST data trasferred by jQuery

jquerypostattributesrel

提问by Léo Léopold Hertz ??

How can you see what the attribute relcontains when it is transferred by POST?

relPOST 传输时如何查看该属性包含的内容?

I transfer a variable by the rel attribute by jQuery. I would like to know what the attribute, $_POST['answer'], contains.

我通过jQuery通过rel属性传输一个变量。我想知道属性 $_POST['answer'] 包含什么。

This question is based on: To make an action based on the link location by jQuery

这个问题基于:To make an action based on the link location by jQuery

jQuery IRC tells me that the solution seems to be Firebug somehow. How can you see POST data in Firebug?

jQuery IRC 告诉我解决方案似乎是 Firebug。 如何在 Firebug 中查看 POST 数据?

回答by redsquare

You can use the Network tab and look at the params tab as shown below (this was a get request to google where I search for the word hello).

您可以使用 Network 选项卡并查看如下所示的 params 选项卡(这是对 google 的 get 请求,我在其中搜索单词 hello)。

alt text
(source: gyazo.com)

替代文字
(来源:gyazo.com

回答by DaveJohnston

There are various tools you can use to capture such information. I use a plugin for Firefox called Live HTTP Headers, which lets you view the HTTP headers that are being transferred in each request, so you would be able to view your post variable.

您可以使用多种工具来捕获此类信息。我为 Firefox 使用了一个名为 Live HTTP Headers 的插件,它允许您查看每个请求中正在传输的 HTTP 标头,因此您将能够查看您的 post 变量。

Firebug can also be used, it is also a plugin available for Firefox. Select the Net tab, then select All. Here you will see a list of all requests. Now you can expand each request to view the headers (and hence the post variables).

Firebug 也可以使用,它也是 Firefox 可用的插件。选择网络选项卡,然后选择全部。在这里您将看到所有请求的列表。现在您可以展开每个请求以查看标头(以及 post 变量)。