Fiddler 将二进制文件数据添加到 POST

编程入门 行业动态 更新时间:2024-10-28 08:16:01
本文介绍了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

本文发布于:2023-11-03 07:58:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1554627.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:二进制文件   数据   Fiddler   POST

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!