Skip to content

Instantly share code, notes, and snippets.

@arturoaviles
Created March 21, 2019 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arturoaviles/04e50dccf1247c3b8e2e6fee0d281471 to your computer and use it in GitHub Desktop.
Save arturoaviles/04e50dccf1247c3b8e2e6fee0d281471 to your computer and use it in GitHub Desktop.
Check Flask Request
print("Request Content Type:", request.content_type)
print("Is it Json?", request.is_json)
print("Request Data Type:",type(request.get_data()))
print("Request Data", request.get_data())
print(request.args)
print(request.get_data().decode('utf-8'))
print(type(request.get_data().decode('utf-8')))
print("Json:", json.dumps(request.get_data().decode('utf-8')))
print("Type:", type(json.dumps(request.get_data().decode('utf-8'))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment