User Tools

Site Tools


python:flask-api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
python:flask-api [15/05/2023 16:05] – created - external edit 127.0.0.1python: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://httpbin.org/anything]]
  
  
Line 7: Line 15:
 curl -i -X POST \ curl -i -X POST \
 -H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
--d "{\"auth_token\":\"${AUTH_TOKEN}\", \"user_id\":\"${EMAIL}\", \"file_ref\":\"File.odt\", \"uuid\":\"${UUID}\"}" \+-d "{\"auth_token\":\"${AUTH_TOKEN}\", \"user_id\":\"${EMAIL}\", \"file_ref\":\"File.odt\", \"uuid\":\"${UUID}\"}"
 http://192.168.11.7:5000/api http://192.168.11.7:5000/api
- 
-# Note:- send to this URL to see just what you have actually sent to help any debugging. 
-# https://httpbin.org/anything 
  
 </code> </code>
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

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki