Browse Source

Web

pull/109/merge
Jure Šorn 1 year ago
parent
commit
091f07fc86
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -2558,7 +2558,7 @@ def serve_html(sport):
return render_template_string('<h1>{{title}}</h1>', title=sport)
```
* **To return an error code use `'abort(<int>)'` and to redirect use `'redirect(<url>)'`.**
* **`'request.args[<str>]'` returns parameter from the query string (URL part after the ?).**
* **`'request.args[<str>]'` returns parameter from the query string (URL part after '?').**
* **Use `'session[key] = value'` to store session data like username, etc.**
### REST Request

2
index.html

@ -2099,7 +2099,7 @@ app.run(host=<span class="hljs-keyword">None</span>, debug=<span class="hljs-key
<ul>
<li><strong>To return an error code use <code class="python hljs"><span class="hljs-string">'abort(&lt;int&gt;)'</span></code> and to redirect use <code class="python hljs"><span class="hljs-string">'redirect(&lt;url&gt;)'</span></code>.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'request.args[&lt;str&gt;]'</span></code> returns parameter from the query string (URL part after the ?).</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'request.args[&lt;str&gt;]'</span></code> returns parameter from the query string (URL part after '?').</strong></li>
<li><strong>Use <code class="python hljs"><span class="hljs-string">'session[key] = value'</span></code> to store session data like username, etc.</strong></li>
</ul>
<div><h3 id="restrequest">REST Request</h3><pre><code class="python language-python hljs"><span class="hljs-meta">@app.post('/&lt;sport&gt;/odds')</span>

Loading…
Cancel
Save