When sending a multipart/form-data POST request that includes a file using the Apidog Web client, the boundary parameter is missing from the auto-generated Content-Type header. This results in a malformed request that servers cannot parse, leading to a server-side exception and a 500 Internal Server Error.
Environment
API Client: Apidog (Web Version, we have our documentation hosted on Apidog.)
Browser: Google Chrome, zen (I didn't test other browsers, but pretty sure most of them are same behavior)
Server Framework: Spring Boot
Expected Result
Apidog Web should automatically generate a valid Content-Type header that includes a unique boundary parameter.
The server should successfully parse this request and process the file upload.
Actual Result
The "Actual Request" view in Apidog confirms that the Content-Type header is sent incorrectly, without any boundary:
Content-Type: multipart/form-data
The receiving server throws a parsing exception. In our case, the Java Spring server log shows:
Java
org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found
The client receives a 500 Internal Server Error in response due to the server’s inability to parse the request.
From our end, we couldn’t reproduce the issue. Did you manually add a content-type Header instead of using the auto-generated one? Please try sending the request without your manual added header.
Nope, actually what I did was sending api request in apidog web itself. After request has not been processed, I checked actual request section in apidog, and figured out this problem.
Could you try using the “No Proxy” option in your docs site setting and try to send it in your docs site? Please refer to the documentation Request proxy in shared docs - Apidog Docs for instructions.
I’m facing the same issue on the documentation website. It happened when the new UI was incoporated. Can the team please take a look. We are able to send API calls from the apidog app and the api responds but from web documentation its giving 400 bad requet.
Hello, we’ve identified from our support team that this issue is related to the mediaType in the API definition. Could you let us know if this API was created through import or manually added? This will help us reproduce and resolve the issue completely.