How do I post multipart/form-data?

1 Answer 175 Views
Fiddler Everywhere
Scott
Top achievements
Rank 1
Scott asked on 06 Jun 2023, 07:10 PM

I started with:

POST https://localhost/test.aspx HTTP/1.1
Content-Type:multipart/form-data; boundary=--------------------------33ce36bc0a80f5ac

--------------------------33ce36bc0a80f5ac
Content-Disposition: form-data; name="file"; filename="41B89C87-0054-4C29-9719-61950EF84D26_md.dmp"
Content-Type: application/octet-stream

<@INCLUDE *C:\Temp\crash\DBD3C7A9-73C9-4536-968E-CE197EA65C0D_md.dmp*@>
--------------------------33ce36bc0a80f5ac
Content-Disposition: form-data; name="json"
Content-Type: application/json

{"v":5, "id":"41B89C87-0054-4C29-9719-61950EF84D26"}
--------------------------33ce36bc0a80f5ac--

But am getting:

This body cannot be parsed as valid form data! Switch to the Raw view to see its contents.

This seems like it should be pretty straightforward... What am I missing?

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 08 Jun 2023, 05:57 AM

Hello Scott,

 

Currently, the Composer supports multipart/form-data through its form-data inspector (sub-inspector of the Body inspector)

The data can be composed as key-value pairs where you can use a base64 string for binary content (instead of the <@INCLUDE @> statement, which is a legacy approach from the old days of Fiddler Classic). Note that Fiddler will automatically create the raw content based on the key-value pairs you input in the form-data inspector.

 

The team has acknowledged the need to provide a UI for adding files, so we have already added this feature in our log for future implementations.

 

Regards,
Nick Iliev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Scott
Top achievements
Rank 1
commented on 08 Jun 2023, 03:01 PM

Thanks Nick... While the <@INCLUDE @> may be 'legacy', it is very important as it would be impractical to convert/encode/cut/paste a large binary file... What I eventually determined was a mismatch in my boundary specification and was able to reduce it to:

Content-Type: multipart/form-data; boundary=33ce36bc0a80f5ac

--33ce36bc0a80f5ac

<part1>

--33ce36bc0a80f5ac

<part2>

--33ce36bc0a80f5ac--
Tags
Fiddler Everywhere
Asked by
Scott
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or