用Fiddler检查POST请求 [英] check POST request with Fiddler

查看:389
本文介绍了用Fiddler检查POST请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Fiddler检查来自Web服务器的响应。我可以通过将URL粘贴到Request Builder中的字段来轻松检查GET方法,并在xml / json中返回响应。有一个选项POST,但我不知道如何将参数传递给POST。

How can I use Fiddler to check the response from a web server. I could easily check the GET method by pasting the url to the field in Request Builder and get the response back in xml/json. There is an option POST, however I don't know how can I pass the parameters to the POST.

例如:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.google.com/accounts/ClientLogin");
request.Method = "POST";

string postData = "accountType=HOSTED_OR_GOOGLE";
postData += "&Email=yourusername@gmail.com";
postData += "&Passwd=yourpassword";
postData += "&service=finance";
postData += "&source=test-test-.01";

如何在Fiddler中将我的数据传递给此POST方法以获得响应?

How can I pass my Data into this POST method in Fiddler to get the response?

推荐答案

最简单的方法是让Fiddler捕获此请求的实例并拖放该会话在请求构建器上。

The simplest way to do this is to have Fiddler capture an instance of this request and drag/drop that session onto the Request builder.

但是自己生成帖子并不难。将RequestBuilder的方法设置为POST,添加标题:

But generating a post yourself isn't hard. Set the RequestBuilder's method to POST, add a header:

Content-Type:application / x-www-form-urlencoded

并在请求正文中填写帖子文本:

And put in the Request Body the text of the post:

accountType = HOSTED_OR_GOOGLE& Email = yourusername@gmail.com& Passwd = yourpassword& service = finance& source = test-test-.01

这篇关于用Fiddler检查POST请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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