My bad. It is documented in the API Java Docs:

* @throws ServletException if this request is not of type
* <code>multipart/form-data</code>


On Sun, Nov 24, 2019 at 3:15 PM Behrang Saeedzadeh <behran...@gmail.com>
wrote:

> When sending such a request, Tomcat throws an exception:
>
> $ curl -d documentDate=foo -d documentOwner=A123
> localhost:8080/file-server/a/upload
> SEVERE
> [http-nio-8080-exec-16]
> org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service()
> for servlet [A.UploadServlet]
> in context with path [/file-server] threw exception
> [org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
> the request doesn't contain a multipart/form-data or multipart/mixed
> stream, content type header is application/x-www-form-urlencoded] with root
> cause
> org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:
> the request doesn't contain a multipart/form-data or multipart/mixed
> stream, content type header is application/x-www-form-urlencoded
>
> Shouldn't Tomcat instead return an empty collection?
>

Reply via email to