docs(15.9): upload files with POST in the admin API pages - #556
Merged
Merged
Conversation
A multipart/form-data upload sent with PUT never delivers its file, so the documented PUT upload requests of the admin API always fail with a "file is required" error. Fess now accepts these uploads by POST. Change the endpoint table, the request line and the curl example to POST on the dictionary, bad word, elevate word and storage API pages in every language.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The admin API pages document file uploads as PUT requests with
multipart/form-data. A multipart body sent with PUT never delivers its file, so every documented upload request fails with a "file is required" error.This changes the uploads to POST on the following 15.9 pages, in every language (de, en, es, fr, ja, ko, zh-cn):
api/admin/api-admin-dict.rst:/api/admin/dict/{type}/upload/{dictId}api/admin/api-admin-badword.rst:/api/admin/badword/uploadapi/admin/api-admin-elevateword.rst:/api/admin/elevateword/uploadapi/admin/api-admin-storage.rst:/api/admin/storage/uploadOn each page, the endpoint table row, the request line and the curl example change from PUT to POST.
Dependency
This depends on the Fess change that adds POST handlers for these upload endpoints (codelibs/fess#3494). Without that change, POST to these paths returns 404. Please merge this PR after the Fess change.