python:flask-api
                Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| python:flask-api [15/05/2023 16:05] – created - external edit 127.0.0.1 | python:flask-api [07/08/2025 09:10] (current) – [Output] andrew | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Output result from API ====== | ====== Output result from API ====== | ||
| + | |||
| + | The BASH below is not specific to Flask, but the MySQL probably is. | ||
| + | |||
| + | ===== Debugging API calls ===== | ||
| + | |||
| + | Send to this URL to see just what you have actually sent to help any debugging. | ||
| + | |||
| + | [[https:// | ||
| Line 7: | Line 15: | ||
| curl -i -X POST \ | curl -i -X POST \ | ||
| -H ' | -H ' | ||
| - | -d " | + | -d " | 
| http:// | http:// | ||
| - | |||
| - | # Note:- send to this URL to see just what you have actually sent to help any debugging. | ||
| - | # https:// | ||
| </ | </ | ||
| Line 20: | Line 25: | ||
| Get output from MySQL in the form of a Tuple and return it | Get output from MySQL in the form of a Tuple and return it | ||
| - | without any html encoding, ie. just as a json object. | + | without any html encoding, ie. just as a json object. It has a 200 hard coded, but it might be wise to check that the result from MySQL is sensible and justifies a 200 return. | 
python/flask-api.1684166740.txt.gz · Last modified:  by 127.0.0.1
                
                