Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Donate
Please sign in before you donate.
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
1 Star 1 Fork 0

APIJSON/APIJSONdocs

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (1)
master
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
The license selected for the repository is subject to the license used by the main branch of the repository.
master
Branches (1)
master
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (1)
master
forms.html 11.92 KB
Copy Edit Raw Blame History
Ruoran Wang authored 2019年10月27日 13:48 +08:00 . Create design_rules.rst file and rebuild the table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>API design style guide &#8212; APIJSON Doc 1.0.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/contentui.css" />
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/language_data.js"></script>
<script type="text/javascript" src="../_static/contentui.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="prev" title="API design style guide" href="design_rules.html" />
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="api-design-style-guide">
<h1>API design style guide<a class="headerlink" href="#api-design-style-guide" title="Permalink to this headline"></a></h1>
<div class="section" id="methods-and-api-endpoints">
<h2>1. Methods and API endpoints<a class="headerlink" href="#methods-and-api-endpoints" title="Permalink to this headline"></a></h2>
<p><strong>GET</strong> : A general way to get counts. You can use dev tools to make edits in a web browser.</p>
<p>Base_url/get/</p>
<div class="content-tabs docutils container">
<div class="tab-content docutils container" id="tab-tab1">
<p class="tab-title">Request</p>
<blockquote>
<div><div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
TableName{
// conditions.
}
}
// eg. To get a post with id = 235:
{
&quot;Post&quot;{
&quot;id&quot;: 235
}
}
</pre></div>
</div>
</div></blockquote>
</div>
<div class="tab-content docutils container" id="tab-tab2">
<p class="tab-title">Response</p>
<blockquote>
<div><div class="highlight-json notranslate"><div class="highlight"><pre><span></span> {
TableName:{ ... },
"code":200,
"msg":"success"
}
// eg.
{
"Moment":{ "id":235, "userId":38710, "content":".."},
"code":200,
"msg":"success"
}
</pre></div>
</div>
</div></blockquote>
</div>
</div>
<p><strong>HEAD</strong> : A general way to get counts. You can use dev tools to make edits in a web browser.</p>
<p>Base_url/head/</p>
<div class="content-tabs docutils container">
<div class="tab-content docutils container" id="tab-tab1">
<p class="tab-title">Request</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
TableName:{
...
}
}
// eg. Get the number of posts posted by the user with id =38710:
{
&quot;Post&quot;:{
&quot;userId&quot;:38710
}
}
</pre></div>
</div>
</div>
<div class="tab-content docutils container" id="tab-tab2">
<p class="tab-title">Response</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
TableName:{&quot;code&quot;:200, &quot;msg&quot;:&quot;success&quot;, &quot;count&quot;:10},
&quot;code&quot;:200,
&quot;msg&quot;:&quot;success&quot;
}
// eg.
{
&quot;Post&quot;:{&quot;code&quot;:200, &quot;msg&quot;:&quot;success&quot;, &quot;count&quot;:10},
&quot;code&quot;:200,
&quot;msg&quot;:&quot;success&quot;
}
</pre></div>
</div>
</div>
</div>
<p><strong>GETS</strong> : Get data with high security and confidentiality like bank accounts, birth date.</p>
<p>Base_url/gets/</p>
<div class="content-tabs docutils container">
<div class="tab-content docutils container" id="tab-tab1">
<p class="tab-title">Request</p>
<blockquote>
<div><div class="highlight-json notranslate"><div class="highlight"><pre><span></span>// You need to add "tag": tag with the same level of post{}. Others are the same as **GET**.
</pre></div>
</div>
</div></blockquote>
</div>
<div class="tab-content docutils container" id="tab-tab2">
<p class="tab-title">Response</p>
<blockquote>
<div><div class="highlight-json notranslate"><div class="highlight"><pre><span></span>// Same as **GET**
</pre></div>
</div>
</div></blockquote>
</div>
</div>
<p><strong>HEADS</strong> : Get counts of confidential data(eg. bank account).</p>
<p>Base_url/heads/</p>
<div class="content-tabs docutils container">
<div class="tab-content docutils container" id="tab-tab1">
<p class="tab-title">Request</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>// You need to add "tag": tag with the same level of post{}. Others are the same as HEAD.
</pre></div>
</div>
</div>
<div class="tab-content docutils container" id="tab-tab2">
<p class="tab-title">Response</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>// Same as HEAD.
</pre></div>
</div>
</div>
</div>
<p><strong>POST</strong> : Add new data to the database.</p>
<p>Base_url/post/</p>
<div class="content-tabs docutils container">
<div class="tab-content docutils container" id="tab-tab1">
<p class="tab-title">Request</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
TableName:{...},
&quot;tag&quot;:tag
}
// The id in {...} is generated automatically when table is built and can’t be set by the user.
// eg. A user with id = 38710 posts a new post:
{
&quot;Post&quot;:{
&quot;userId&quot;:38710,
&quot;content&quot;:&quot;APIJSON,let interfaces and documents go to hell !&quot;
},
&quot;tag&quot;:&quot;Moment&quot;
}
</pre></div>
</div>
</div>
<div class="tab-content docutils container" id="tab-tab2">
<p class="tab-title">Response</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span> {
TableName:{
&quot;code&quot;:200,
&quot;msg&quot;:&quot;success&quot;,
&quot;id&quot;:38710
},
&quot;code&quot;:200,
&quot;msg&quot;:&quot;success&quot;
}
// eg.
{
&quot;Moment&quot;:{
&quot;code&quot;:200,
&quot;msg&quot;:&quot;success&quot;,
&quot;id&quot;:120
},
&quot;code&quot;:200,
&quot;msg&quot;:&quot;success&quot;
}
</pre></div>
</div>
</div>
</div>
<p><strong>PUT</strong> : Make changes to a specific item. Only change the part sent to server.</p>
<p>Base_url/put/</p>
<div class="content-tabs docutils container">
<div class="tab-content docutils container" id="tab-tab1">
<p class="tab-title">Request</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span> {
TableName:{
&quot;id&quot;:id,
...
},
&quot;tag&quot;:tag
}
// You can also add multiple id as id{}.
// eg. Make changes to post content with id= 235:
{
&quot;Post&quot;:{
&quot;id&quot;:235,
&quot;content&quot;:&quot;APIJSON,let interfaces and documents go to hell !&quot;
},
&quot;tag&quot;:&quot;Post&quot;
}
</pre></div>
</div>
</div>
<div class="tab-content docutils container" id="tab-tab2">
<p class="tab-title">Response</p>
<blockquote>
<div><div class="highlight-json notranslate"><div class="highlight"><pre><span></span>\\ Same as POST.
</pre></div>
</div>
</div></blockquote>
</div>
</div>
<p><strong>DELETE</strong> : Delete data.</p>
<p>Base_url/delete/</p>
<div class="content-tabs docutils container">
<div class="tab-content docutils container" id="tab-tab1">
<p class="tab-title">Request</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
TableName:{
&quot;id&quot;:id
},
&quot;tag&quot;:tag
}
// You can also add multiple id as id{}.
// Or Delete contents with multiple id:
{
&quot;Comment&quot;:{
&quot;id{}&quot;:[100,110,120]
},
&quot;tag&quot;:&quot;Comment[]&quot;
}
</pre></div>
</div>
</div>
<div class="tab-content docutils container" id="tab-tab2">
<p class="tab-title">Response</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>{
TableName:{
&quot;id&quot;:id
},
&quot;tag&quot;:tag
}
// You can also add multiple id as id{}.
// Or Delete contents with multiple id:
{
&quot;Comment&quot;:{
&quot;id{}&quot;:[100,110,120]
},
&quot;tag&quot;:&quot;Comment[]&quot;
}
</pre></div>
</div>
</div>
</div>
<p><strong>Note:</strong></p>
<blockquote>
<div><ol class="arabic simple">
<li><p>TableName means the name of the table where you get data. It’ll respond with a JSON Object(the form is {....})with columns inside.</p></li>
<li><p>"tag":tag is needed when methods are not GET or HEAD. The tag after the colon is the key in JSON Object of making requests. Generally, it’s the name of the table you’re looking for.</p></li>
<li><p>GET, HEAD are methods for general data requests.They support versatile JSON Object structure. Other methods are used for requesting confidential data and the requesting JSON Object needs to be in the same form/order as that in the database. Otherwise, the request shall be denied.</p></li>
<li><p>GETS and GET, HEADS and HEAD return the same type of data. But the request form is a little different.</p></li>
<li><p>For HTTP, all API methods (get,gets,head,heads,post,put,delete) make requests with HTTP POST.</p></li>
<li><p>All JSON Objects here are with {...} form. You can put items or objects in it.</p></li>
<li><p>Each object in the database has a unique address.</p></li>
</ol>
</div></blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="../index.html">APIJSON Doc</a></h1>
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Quick Start</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../introduction/introduction.html">Features</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/server_deployment/server_deployment.html">Server-side Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quick_start/client_deployment/client_deployment.html">Client-side Development</a></li>
</ul>
<p class="caption"><span class="caption-text">Documentation</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="design_rules.html">API design style guide</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">API design style guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#methods-and-api-endpoints">1. Methods and API endpoints</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="design_rules.html" title="previous chapter">API design style guide</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, Ruoran Wang.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.1.2</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="../_sources/documentation/forms.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

The English APIJSON documentation. Forked from the original Repositry:
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/APIJSON/APIJSONdocs.git
git@gitee.com:APIJSON/APIJSONdocs.git
APIJSON
APIJSONdocs
APIJSONdocs
master
Going to Help Center

Search

Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /