Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Flask Dummy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ralf Klammer
Flask Dummy
Commits
2727e713
Commit
2727e713
authored
1 year ago
by
Ralf Klammer
Browse files
Options
Downloads
Patches
Plain Diff
Add examples to README.MD
parent
d38028f6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#127806
failed
1 year ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.MD
+41
-0
41 additions, 0 deletions
README.MD
with
41 additions
and
0 deletions
README.MD
+
41
−
0
View file @
2727e713
...
...
@@ -51,6 +51,47 @@ project_app
project_code
```
## Examples
### Download CSV file
Look for following code in
`project_app/app.py`
:
```
python
@app.route
(
"
/download_csv
"
,
methods
=
[
"
GET
"
])
def
download_csv
():
```
You can simply access this route via browser: http://127.0.0.1:8083/download_csv?input_value=1000
### Get JSON Response
#### via GET
Look for following code in
`project_app/app.py`
:
```
python
@app.route
(
"
/json_response
"
,
methods
=
[
"
GET
"
])
def
get_json_via_get
():
```
You can simply access this via browser: http://127.0.0.1:8083/json_response
#### via POST
Look for following code in
`project_app/app.py`
:
```
python
@app.route
(
"
/json_response
"
,
methods
=
[
"
POST
"
])
def
get_json_via_post
():
```
You can NOT access this via browser, but you can access it as ajax request. Look for the following code in
`project_app/static/js/main.js`
:
```
JavaScript
$('.get_json').click(get_json_via_post)
```
## Configuration
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment