Hello, friends, in this video, we shall discuss the attributes of it, request object in a flask
and water flask application framework.
The client's request when the client in his client's browser, you know, gives a certain you all the
request is received by the server.
So the client request is processed by a global request object in order to process this request data.
What do you need to do?
You need to import the request object from the flask module.
So you're allowed to say from flask import request, something like this that should be in the beginning
of your python.
Call the request object.
Sluts are also created as the client sends a certain request that request object has.
A number of important attributes, some of the attributes I will try to explain, first and foremost,
the important object is the form attribute which is available to the request object.
And this form object, form, attribute is.
You know, I believe the value to the format is available, especially when the request is sent, using
either the post method or put method to post and put requests will generate or will have a value to
the form attribute of the request object.
As against that, if the request is sent with the get the matter, then the there will be a certain
value to the Iago's at arguments attribute when the data is received by the server with the help of
a gatemouth.
The value is a barometer or attribute, which is a combination of the and arguments.
Both forms and arguments will form the values attribute cookies is another very important attribute
later on, in the course of our discussion, we'll come across what cookies?
So cookies are nothing but the.
Not all the stored information that the server stores in their clients computer.
So when the client revisits the server along with the request, the cookies are also a transmitter transmitted
or dispatched to the Web server so that later on the server will be able to identify earlier transactions
of the same client with the server.
So for that, the cookies are there.
We'll discuss that part in more detail.
But then cookies is a dictionary object which contains the cookies and the values that are transmitted
by the client to the sun.
It's a very important attribute of the request object, the incoming requests headers, they are stalling
again in the form of a dictionary and they are an attribute of the request.
Object data contains the incoming request that ideastream, especially when the mime type is such that
the application cannot recognize it, then in that case, the data will be treated as a stream.
Files these files attribute will contain the contents of the file, which is uploaded by the client
to this or this is a very important attribute of the request object which will be required for file
uploading activity.
The files attribute also has a very important function called a SEAL.
In order to save the uploaded file on the server, you must execute this same function.
We also have an example of the uploading process further in the course.
During that, we shall discuss this in more detail.
And while this is an underlying WGI environment matter, which method is used to send the request either
get output.
We have seen the different methods.
The request method will identify which method was used and what in the name of the current module is
stored in the attribute called as module.
And lastly, routing exception.
Default value is none when this when this Rübig exception will be raised, when the you are ill that
is sent by the client is not matched with any of the others, then routing exception will be raised.
And most probably it will generally say in not found, exceptions will be generated.
So this was all the discussion about the request object and it and its attributes.
In the next few days we should see the processing of the form with the help of the post example was
method.