From 4c8caa60508f1c23b21343b82bfba525b8c610a5 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Sat, 5 Oct 2024 18:10:34 +0800 Subject: feat(docs): update requirements and docs content with new sphinx extensions and translations --- docs/source/restful.rst | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 docs/source/restful.rst (limited to 'docs/source/restful.rst') 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 -- cgit v1.2.3-70-g09d2