[Answer]-Request.POST empty for Content-Type: multipart/form-data; boundary=xYzZY

1👍

As mentioned in the UPDATE, I was using Runscope to test the POST data. I realised that the error was with the way Runscope handled multipart/form-data. I raised the issue with support and got notified that Runscope does not support multipart as of now. I’ve copied the relevant information here:

We hope to support multipart form uploads capabilities for the future, but don’t have a timeline on when this will be available. Some customers have made this work in their Radar tests (https://www.runscope.com/docs/radar) by pasting in the raw multipart-formatted body or unicode string input body into the request and making sure to include the applicable ‘Content-type’ header value with the correct boundaries. Some examples for building a multipart/form-data POST request can be found here: http://chxo.com/be2/20050724_93bf.html

For Runscope URLs, multipart data is passed through unmodified. However, the request editor and retries from the Traffic Inspector (https://www.runscope.com/docs/inspector) do not currently support multipart data which is why your request retry did not work. Additionally, request and response bodies larger than 1 MB are not saved for viewing after the request has been sent.

Using another service solved this for me.

0👍

You are (in a manner) in control of Content-Type. What you’re looking for is enctype. You can use it as following:

<form method="POST" action="." enctype="multipart/form-data">

enctype is only required when you are uploading a file, otherwise, it’s not.

👤xyres

Leave a comment