Giter Club home page Giter Club logo

Comments (3)

codespearhead avatar codespearhead commented on August 11, 2024

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.

beuss avatar beuss commented on August 11, 2024

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.

wilkinsona avatar wilkinsona commented on August 11, 2024

I agree, @beuss. I see no reason to close this issue.

from spring-restdocs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.