Introduction
When we access a website, we receive a lot of information from the website's server into our browser. This information can be in images, texts, videos, and objects.
However, our browser only displays the intended result of all the information as intended by the programmer.
All we do is request our browser for a particular website by typing its name on the URL tab but, what exactly happens when we do that?
Our browser requests a response from the server of the website we tried to access and, in response, receive an object. This object contains all the data that our browser then understands and displays accordingly.
Then, as we press different buttons or images of the website, the behavior of the website keeps changing as the browser keeps requesting the data from the server.
This Client-Server relationship is possible with the help of Flask Request Object.
The Flask Request Object is used to perform both sending and receiving operations from a user's browser to the server and process the request data from the server. It should be imported from the flask module.
Attributes of a Flask Request Object
As discussed above, the data from a client’s webpage is sent to the server as a global request object, and to process this received object, it should be imported from the Flask Module.
The request objects have specific attributes attached to them:
SN. |
Attributes |
Description |
1. |
Form |
Houses various Key-Value pairs of form parameters |
2. |
Args |
The URL contents that are located after the (?) |
3. |
Cookies |
These are temporary files used to track user sessions as they hold the names and values of cookies. |
4. |
Files |
Holds every information about the uploaded file |
5. |
Method |
Displays the ongoing request method (POST, GET, etc.) |
6. |
Values |
These are combined dictionaries that contain data of both forms and arguments. |
7. |
Data |
Contains the incoming request data in strings |
8. |
Headers |
Stores the incoming request as a dictionary-like object |
9. |
Module |
The current module's name if the request was dispatched to an actual module. |
10. |
Environ |
The underlying WSGI environment |




