Postman multipart/form-data error: Missing start boundary

荒凉一梦 提交于 2019-12-12 09:30:35

问题


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.



来源:https://stackoverflow.com/questions/33174296/postman-multipart-form-data-error-missing-start-boundary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!