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?
相关问题
- Upload file to Google Cloud Storage using AngularJ
- Most efficient way to turn factor matrix into bina
- codeigniter $this->upload->do_upload() = false
- Cast some light on population count algorithm
- Haskell - How to create a mapTree function based o
相关文章
- File Upload of more than 4GB
- The current request is not a multipart request - S
- Input file in laravel 5.2?
- How to get path of the php binary on server where
- Unsigned char c = 255 is “11111111” or not?
- Converting cookie string into Python dict
- Why does my form not upload files in Internet Expl
- PHP ftp_put fails
I'm sure this is a new feature in the year since this question was answered, but thought I'd add it anyhow:
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:\Some\Path\my-image.jpg@>
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.
In Fiddler script: (in Fiddler: Rules... Customize Rules), find the OnBeforeRequest function, and add a line similar to:
In order to send multipart/form-data, this receipe will be helped.
In upper panel (Http header), set
Content-Type
as below. Other values are automatically resolved.And, input Response Body at the below panel as follows.
The import rules are,
Content-Type
should have two more-
signs than boundary words in body.-
signs.since version 2.0, the Request Body has an "Upload File..." link that allows you to post/upload binary data.