Postman multipart/form-data error: Missing start b

2019-04-19 03:32发布

问题:

I'm trying to hit my server's endpoint with a multipart/form-data request sent from Postman. I'm getting a 400 Bad Request and the cause is:

org.jvnet.mimepull.MIMEParsingException: Missing start boundary.

How can I set the start boundary and how do I know what it should be?

回答1:

https://github.com/postmanlabs/postman-app-support/issues/191 Following that thread here seems that setting the request header to Content-Type multipart/form-data I'm overriding the value set by Postman.

There is no need to add a content-type header manually. You are overriding the value set by Postman. Just select form-data in POST request and send your request to see if it works.

Removing the header allowed me to hit my endpoint.



回答2:

Overriding POSTMAN header values is the issue as mentioned by Anton above. Here is how your headers and request body should look like for standalone POSTMAN client:



回答3:

As a work around try this:

spring: jersey: application-path: /rest # Path that serves as the base URI for the application. Overrides the value of "@ApplicationPath" if specified. filter.order: 0 # Jersey filter chain order. type: servlet # Can be either "servlet" or "filter". init.*:

type servlet worked fine, where as filter is throwing the Start Boundary error.