diff options
| author | 2024-10-05 18:10:34 +0800 | |
|---|---|---|
| committer | 2024-10-05 18:10:34 +0800 | |
| commit | 4c8caa60508f1c23b21343b82bfba525b8c610a5 (patch) | |
| tree | a40cd59eb78d60349431d977f11587cbc97fb9ac /docs/source/restful.rst | |
| parent | e614fd92c3288dd862ffb696cacaa9aadd11516c (diff) | |
| download | HydroRoll-4c8caa60508f1c23b21343b82bfba525b8c610a5.tar.gz HydroRoll-4c8caa60508f1c23b21343b82bfba525b8c610a5.zip | |
feat(docs): update requirements and docs content with new sphinx extensions and translations
Diffstat (limited to 'docs/source/restful.rst')
| -rw-r--r-- | docs/source/restful.rst | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/docs/source/restful.rst b/docs/source/restful.rst new file mode 100644 index 0000000..b5c2d5b --- /dev/null +++ b/docs/source/restful.rst @@ -0,0 +1,52 @@ +Restful API 参考手册 +==================== + +users +----- + + +.. http:get:: /users/(int:user_id)/posts/(tag) + + The posts tagged with `tag` that the user (`user_id`) wrote. + + **Example request**: + + .. sourcecode:: http + + GET /users/123/posts/web HTTP/1.1 + Host: example.com + Accept: application/json, text/javascript + + **Example response**: + + .. sourcecode:: http + + HTTP/1.1 200 OK + Vary: Accept + Content-Type: text/javascript + + [ + { + "post_id": 12345, + "author_id": 123, + "tags": ["server", "web"], + "subject": "I tried Nginx" + }, + { + "post_id": 12346, + "author_id": 123, + "tags": ["html5", "standards", "web"], + "subject": "We go to HTML 5" + } + ] + + :query sort: one of ``hit``, ``created-at`` + :query offset: offset number. default is 0 + :query limit: limit number. default is 30 + :reqheader Accept: the response content type depends on + :mailheader:`Accept` header + :reqheader Authorization: optional OAuth token to authenticate + :resheader Content-Type: this depends on :mailheader:`Accept` + header of request + :statuscode 200: no error + :statuscode 404: there's no user
\ No newline at end of file |
