邮递员多部分/表单数据错误:缺少开始边界

Postman multipart/form-data error: Missing start boundary(邮递员多部分/表单数据错误:缺少开始边界)

本文介绍了邮递员多部分/表单数据错误:缺少开始边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Postman 发送的 multipart/form-data 请求访问我的服务器端点.我收到 400 错误请求,原因是:

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?

推荐答案

https://github.com/postmanlabs/postman-app-support/issues/191 在此线程之后,似乎将请求标头设置为 Content-Type multipart/form-data 我正在覆盖 Postman 设置的值.

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.

无需手动添加内容类型标头.你是覆盖 Postman 设置的值.只需在 POST 中选择表单数据请求并发送您的请求,看看它是否有效.

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.

这篇关于邮递员多部分/表单数据错误:缺少开始边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:邮递员多部分/表单数据错误:缺少开始边界

基础教程推荐