Fiddler 将二进制文件数据添加到 POST [英] Fiddler add binary file data to POST

查看:40
本文介绍了Fiddler 将二进制文件数据添加到 POST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将二进制文件数据直接添加到 POST 调用的请求正文中,以便模拟文件上传.但是,我尝试设置一个请求前"断点并使用插入文件",但我似乎无法让它工作.我还尝试修改 CustomRules.js 以注入文件,但无法弄清楚如何通过 JScript 加载二进制数据.这里有简单的解决方案吗?

I'm try to add binary file data directly to the request body of a POST call so I can simulate a file upload. However, I tried setting a 'before request' breakpoint and using 'insert file' but I couldn't seem to get that to work. I also tried to modify CustomRules.js to inject the file but couldn't figure out how to load binary data via JScript. Is there an easy solution here?

推荐答案

我确信这是自这个问题得到解答以来的一年中的一个新功能,但我想无论如何我都会添加它:

I'm sure this is a new feature in the year since this question was answered, but thought I'd add it anyhow:

现在 Composer 中有一个蓝色的[上传文件]"链接,位于 URL 文本框的右侧.这将创建一个完整的多部分/表单数据请求.如果你使用它,你会注意到你现在有一些看起来像这样的东西:

There's a blue "[Upload file]" link in Composer now on the right side under the URL textbox. This will create a full multipart/form-data request. If you use this, you'll notice in the body you now have something that looks like this:

<@INCLUDE C:SomePathmy-image.jpg@>

<@INCLUDE C:SomePathmy-image.jpg@>

在我的情况下,我只是想直接发布二进制文件,没有多部分垃圾,所以我只是将 <@INCLUDE ... @> 魔术放在请求正文中,并将二进制文件作为正文发送.

In my case, I just wanted to POST the binary file directly with no multipart junk, so I just put the <@INCLUDE ... @> magic in the request body, and that sends the binary file as the body.

这篇关于Fiddler 将二进制文件数据添加到 POST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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