Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
@jenkins-plone-org please run jobs |
davisagli
left a comment
There was a problem hiding this comment.
This is simpler than I expected! Thanks for starting it.
stevepiercy
left a comment
There was a problem hiding this comment.
Thanks for this addition. Please see my comment.
| ``` | ||
| POST /++api++/folder1 HTTP/1.1 | ||
| Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW | ||
|
|
||
| ------WebKitFormBoundary7MA4YWxkTrZu0gW | ||
| Content-Disposition: form-data; name="data" | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "@type": "File", | ||
| "title": "My file", | ||
| "file": { | ||
| "data": "attachment_002", | ||
| }, | ||
| "leadimage": { | ||
| "data": "attachment_001", | ||
| } | ||
| } | ||
| ------WebKitFormBoundary7MA4YWxkTrZu0gW | ||
| Content-Disposition: form-data; name="attachment_001"; filename="profile.jpg" | ||
| Content-Type: image/jpeg | ||
|
|
||
| [Binary data of the JPEG file] | ||
| ------WebKitFormBoundary7MA4YWxkTrZu0gW | ||
| Content-Disposition: form-data; name="atttachment_02"; filename="docuument.docx" | ||
| Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document | ||
|
|
||
| [Binary data of the Word document] | ||
| ------WebKitFormBoundary7MA4YWxkTrZu0gW-- | ||
| ``` |
There was a problem hiding this comment.
Please see how to document examples at https://6.docs.plone.org/plone.restapi/docs/source/contributing/index.html#generate-documentation-examples. I'd suggest using the Plone logo for the image (https://6.docs.plone.org/_static/logo.svg) and "Hello, Plone" in a Libre Office file as the binary data.
Co-authored-by: Steve Piercy <web@stevepiercy.com>
|
Enabling multipart/form-data for PATCH requires zopefoundation/Zope#1274, which fixes the request parsing needed for multipart handling on PATCH requests. |
|
@davisagli Because of the Zope fix, the tests are green only on Plone 6.2 (Zope 6) and 5.2 (Zope 4). |
|
@mamico It can be enabled for Plone 6.2 only, as long as it doesn't break other things on older versions. In that case we should skip the tests on older versions, and be sure to mention in the docs that that feature is version-dependent. |
If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.
Closes #1730
📚 Documentation preview 📚: https://plonerestapi--1953.org.readthedocs.build/