使用 Fiddler 检查 POST 请求
如何使用 Fiddler 检查 Web 服务器的响应。我可以通过将 url 粘贴到 Request Builder 中的字段来轻松检查 GET 方法,并以 xml/json 形式获取响应。有一个选项 POST,但我不知道如何将参数传递给 POST。
例如:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.google.com/accounts/ClientLogin");
request.Method = "POST";
string postData = "accountType=HOSTED_OR_GOOGLE";
postData += "&[email protected]";
postData += "&Passwd=yourpassword";
postData += "&service=finance";
postData += "&source=test-test-.01";
如何将我的数据传递到 Fiddler 中的 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.
For example:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.google.com/accounts/ClientLogin");
request.Method = "POST";
string postData = "accountType=HOSTED_OR_GOOGLE";
postData += "&[email protected]";
postData += "&Passwd=yourpassword";
postData += "&service=finance";
postData += "&source=test-test-.01";
How can I pass my Data into this POST method in Fiddler to get the response?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的方法是让 Fiddler 捕获此请求的实例并将该会话拖放到请求构建器上。
但自己生成帖子并不难。将 RequestBuilder 的方法设置为 POST,添加标头:
Content-Type: application/x-www-form-urlencoded
并在请求正文中放入帖子的文本:
accountType=HOSTED_OR_GOOGLE& [电子邮件受保护]&Passwd=yourpassword&service=finance&source=test-test-.01
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.
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 protected]&Passwd=yourpassword&service=finance&source=test-test-.01
第 1 步:带有 Http Post、URL、标头和正文的 Composer
第 2 步:在服务器上使用 Json 结果 console.log
Step 1: Composer with Http Post, URL, Header and Body
Step 2: And Result console.log at Server with Json