spring-projects / spring-projects/spring-framework

Clarification on multipart/mixed usage and examples provided in docs

Open
#30,920 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

in: web type: documentation
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

I'm seeking clarification on this documentation snippet. It indicates "non-browser RESTful service scenarios for multipart/mixed but then provides example data inconsistent with a multipart/mixed request body requirements, specifically the header data for which the example is based on.

mixed bodies use the content-disposition header but the named properties are not required in the same way a form-data request requires these parameters.

Can you please document a valid example of how to use multipart/mixed without relying on these name parameters in the content-disposition header? Subsequently, can you point to the correct documentation to implement the same without the form-data name parameter?

You can also submit multipart requests from non-browser clients in a RESTful service scenario. The following example uses a file along with JSON:

POST /someUrl
Content-Type: multipart/mixed

--edt7Tfrdusa7r3lNQc79vXuhIIMlatb7PQg7Vp
Content-Disposition: form-data; name="meta-data"
Content-Type: application/json; charset=UTF-8
Content-Transfer-Encoding: 8bit

{
	"name": "value"
}
--edt7Tfrdusa7r3lNQc79vXuhIIMlatb7PQg7Vp
Content-Disposition: form-data; name="file-data"; filename="file.properties"
Content-Type: text/xml
Content-Transfer-Encoding: 8bit
... File Data ...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.