Some of the properties of the Request and Response objects are metadata, some are parsed, and others are just links.
Request
method
Start Row, metadata
host
Start Row, metadata
path
Start Row, metadata
environ
Where SERVER_PROTOCOL
is the starting row, the meta-data
headers
header, Meta data
data
Body, meta data
remote_addr
Client Address
args
Parameters in the request link (GET parameters), after parsing
form
Parameters in form submission, after parsing
values
The collection of args and forms
json
Body data in JSON format, after parsing
cookies
Links to Cookies
The Request object classifies the parameters very fine, note args
, form
, valeus
and json
the difference. Of course the most insurance and the most primitive way is to resolve themselves data
.
Another area to be aware of is the type of some attributes, not the Python standard dict
, but multidict or combinedmultidict. This is to deal with the setting that the parameters in the HTTP protocol are repeatable. So pay attention to the properties of these objects, such as the .get()
.get_list()
things returned by the method.
Response
status
Status code, meta data
status_code
Contains only the status of code
headers
header, Meta data
mimetype
Remove the content type of charset, such asapplication/json
data
Body, meta data
Flask's request and response objects