Closed QyInvoLing closed 2 years ago
What action are you trying to perform?
To create a new page, POST
to /api/pages
(without any ID)
To update a page, PATCH
to /api/pages/<id>
This is the standard JSON:API spec https://jsonapi.org/format/#crud-updating which I believe is also closely followed by all Flarum core REST endpoints.
If your HTTP client doesn't support PATCH
, you can use the X-HTTP-Method-Override: PATCH
header with a POST request.
OK, after using patch, it works perfectly. Thank you!
Bug Report
Current Behavior I tried to directly interact with the api /api/pages with authorization of Flarum official api keys, which caused error.
Steps to Reproduce The node source code I used is here:
which caused an 405 error: { errors: [ { status: '405', code: 'method_not_allowed' } ] }
I've already used this api key before with official/extensions' api interfaces, which performs correctly. But when it comes into FofPages, error occurs.
Environment
Possible solution(s) Check if the api of this extension matches the standard of Flarum