Comments (3)
Media type multipart/form-data
is only defined for the POST
method as per RFC 2616:
Note: The "multipart/form-data" type has been specifically defined for carrying form data suitable for processing via the POST request method, as described in RFC 1867 [15]
Which is clarified by errata RFC 5789:
the operation does not modify the resource identified by the Request-URI in a predictable way that's defined by the semantics of the PATCH media type, POST should be considered instead of PATCH or PUT.
That's why MDN web docs says PATCH
shouldn't be used for binary data, as stated by this answer:
PATCH
is not for uploading binary data (like what you want with the image), see: https://developer.mozilla.org/en-US/docs/web/http/methods/patch (Allowed in HTML Forms: No)
This issue should be closed in my opinion.
from spring-restdocs.
1 - Well "specifically designed", doesn't mean "restricted to", I don't see any normative content in the note (no "SHOULD/MUST not be used with other HTTP methods" or so). Moreover HttpRequestSnippet
already handles parts for PUT requests
2 - Don't see how multipart/form-data implies that the resource isn't modified in a predictable way
3 - The answer you quote finishes by
Uploading binary data (like images) has to be done with POST always, PUT or PATCH are used to modify the attributes of the ressource.
Don't see why a resource cannot embed binary data. Moreover, MDN isn't a normative document
from spring-restdocs.
I agree, @beuss. I see no reason to close this issue.
from spring-restdocs.
Related Issues (20)
- Getting issue related to query parameter. HOT 5
- Latest dependencies issue is coming while generating rest docs HOT 2
- Any concern that the underlying asciidoc gradle plugin doesn't work with Java 17 or 21? HOT 1
- Upgrade Gradle Enterprise Plugins
- Using JWT Token to Access Resource Server HOT 2
- Cannot document form parameters when using Rest Assured's MockMvc support when contentType is multipart/form-data HOT 5
- Upgrade to Gradle Enterprise Conventions 0.0.16
- Move to GitHub Actions to build and deploy snapshots
- Run Windows and Java compatibility builds on GitHub Actions
- Document that the query string should be provided in the URL or by using queryParam when using MockMvc HOT 1
- JavaDoc support HOT 1
- Upgrade to Gradle Enterprise Conventions 0.0.17
- Issue with the Junit Rest Documentation with the spring docs 2.0.5.Release and spring boot version 2.7.6 version in controller testcases HOT 2
- Facing issue with asciidoctor.jvm.convert 2.4.0 and spring docs 2.0.5 release Which is unable to load the child.html in the index html HOT 2
- Facing issue with asciidoctor.jvm.convert 2.4.0 and spring docs 2.0.5 release while creating war using gradle 8.6 the public/docs folder is not getting created HOT 3
- Improve usage documentation for markdown HOT 2
- MockMVC module isn't compatible with Spring Framework 6.2 HOT 1
- Upgrade to Compatibility Test Plugin 0.0.3
- Consistency with the subsection path.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-restdocs.