|
5 | 5 | Methods | URL | Request | Response |
6 | 6 | ------------ | ------------ | ------------ | ------------ |
7 | 7 | **GET**: <br > A general way to get data.<br > You can use dev tools to make edits in a web browser. | base_url/get/ | {<br > TableName:{<br > //Add contiditions here.<br > }<br >} <br > <br > Eg. To get a post with `id = 235`:<br >{<br > "Post":{<br > "id":235<br > }<br >} | {<br > TableName:{<br > ...<br > },<br > "code":200,<br > "msg":"success"<br >}<br >Eg.<br >{<br > "Moment":{<br > "id":235,<br > "userId":38710,<br > "content":"APIJSON,let interfaces and documents go to hell !"<br > },<br > "code":200,<br > "msg":"success"<br > } |
8 | | -**HEAD**: <br > A general way to get counts.<br > You can use dev tools to make edits in a web browser. | base_url/head/ | {<br > TableName:{<br > …<br > }<br > } <br > {…} are conditions. <br ><br > Eg. Get the number of posts posted by the user with `id = 38710`:<br >{<br > "Post":{<br > "userId":38710<br > }<br >} | {<br > TableName:{<br > "code":200,<br > "msg":"success",<br > "count":10<br > },<br > "code":200,<br > "msg":"success"<br >} <br > Eg.<br >{<br > "Post":{<br > "code":200,<br > "msg":"success",<br > "count":10<br > },<br > "code":200,<br > "msg":"success"<br >} |
9 | | -**GETS**: <br > Get data with high security and confidentiality.<br > Eg. bank accounts, birth date. | base_url/gets/ | You need to add ` "tag": tag` with the same level of `post{}`. Others are the same as **GET**. | Same as **GET**. |
10 | | -**HEADS**: <br > Get counts of confidential data(eg. bank account).| base_url/heads/ | You need to add `"tag": tag` with the same level of `post{}`. Others are the same as **HEAD**. | Same as **HEAD**. |
11 | | -**POST**: <br > Add new data. | base_url/post/ | {<br > TableName:{<br > …<br > },<br > "tag":tag<br >} <br > The id in {...} is generated automatically when table is built and can’t be set by the user. <br ><br >Eg. A user with `id = 38710` posts a new post:<br >{<br > "Post":{<br > "userId":38710,<br > "content":"APIJSON,let interfaces and documents go to hell !"<br > },<br > "tag":"Moment"<br >} | {<br > TableName:{<br > "code":200,<br > "msg":"success",<br > "id":38710<br > },<br > "code":200,<br > "msg":"success"<br >}<br >Eg.<br >{<br > "Moment":{<br > "code":200,<br > "msg":"success",<br > "id":120<br > },<br > "code":200,<br > "msg":"success"<br >} |
12 | | -**PUT**: <br > Make changes to a specific item.<br > Only change the part sent to server. | base_url/put/ | {<br > TableName:{<br > "id":id,<br > …<br > },<br > "tag":tag<br >} <br > You can also add multiple id as `id{}`.<br ><br >Eg. Make changes to post content with id= 235:<br >{<br > "Post":{<br > "id":235,<br > "content":"APIJSON,let interfaces and documents go to hell !"<br > },<br > "tag":"Post"<br >} | Same as **POST**. |
| 8 | +**HEAD**: <br > A general way to get counts.<br > You can use dev tools to make edits in a web browser. | base_url/head/ | {<br > TableName:{<br > …<br > }<br > } <br > {…} are conditions. <br ><br > Eg. Get the number of posts posted by the user with `id = 38710`:<br >{<br > "Moment":{<br > "userId":38710<br > }<br >} | {<br > TableName:{<br > "code":200,<br > "msg":"success",<br > "count":10<br > },<br > "code":200,<br > "msg":"success"<br >} <br > Eg.<br >{<br > "Moment":{<br > "code":200,<br > "msg":"success",<br > "count":10<br > },<br > "code":200,<br > "msg":"success"<br >} |
| 9 | +**GETS**: <br > Get data with high security and confidentiality.<br > Eg. bank accounts, birth date. | base_url/gets/ | You need to add ` "tag": tag` with the same level of `Moment:{}`. Others are the same as **GET**. | Same as **GET**. |
| 10 | +**HEADS**: <br > Get counts of confidential data(eg. bank account).| base_url/heads/ | You need to add `"tag": tag` with the same level of `Moment:{}`. Others are the same as **HEAD**. | Same as **HEAD**. |
| 11 | +**POST**: <br > Add new data. | base_url/post/ | {<br > TableName:{<br > …<br > },<br > "tag":tag<br >} <br > The id in {...} is generated automatically when table is built and can’t be set by the user. <br ><br >Eg. A user with `id = 38710` posts a new post:<br >{<br > "Moment":{<br > "userId":38710,<br > "content":"APIJSON,let interfaces and documents go to hell !"<br > },<br > "tag":"Moment"<br >} | {<br > TableName:{<br > "code":200,<br > "msg":"success",<br > "id":38710<br > },<br > "code":200,<br > "msg":"success"<br >}<br >Eg.<br >{<br > "Moment":{<br > "code":200,<br > "msg":"success",<br > "id":120<br > },<br > "code":200,<br > "msg":"success"<br >} |
| 12 | +**PUT**: <br > Make changes to a specific item.<br > Only change the part sent to server. | base_url/put/ | {<br > TableName:{<br > "id":id,<br > …<br > },<br > "tag":tag<br >} <br > You can also add multiple id as `id{}`.<br ><br >Eg. Make changes to post content with id= 235:<br >{<br > "Moment":{<br > "id":235,<br > "content":"APIJSON,let interfaces and documents go to hell !"<br > },<br > "tag":"Moment"<br >} | Same as **POST**. |
13 | 13 | **DELETE**: <br > Delete data. | base_url/delete/ | {<br > TableName:{<br > "id":id<br > },<br > "tag":tag<br >} <br > You can also add multiple id as `id{}`. <br ><br > Or Delete contents with multiple id:<br >{<br > "Comment":{<br > "id{}":[100,110,120]<br > },<br > "tag":"Comment[]"<br >} | {<br > TableName:{<br > "code":200,<br > "msg":"success",<br > "id[]":[100,110,120]<br > "count":3<br > },<br > "code":200,<br > "msg":"success"<br >}<br >Eg.<br >{<br > "Comment":{<br > "code":200,<br > "msg":"success",<br > "id[]":[100,110,120],<br > "count":3<br > },<br > "code":200,<br > "msg":"success"<br >} |
14 | 14 |
|
15 | 15 | **Note**:<br /> |
|
0 commit comments