Flask – HTTP methods
Http protocol is the foundation of data communication in world wide web. Different methods of data retrieval from specified URL are defined in this protocol.
The following table summarizes different http methods −
|Sr.No.||Methods & Description|
Sends data in unencrypted form to the server. Most common method.
Same as GET, but without response body
Used to send HTML form data to server. Data received by POST method is not cached by server.
Replaces all current representations of the target resource with the uploaded content.
Removes all current representations of the target resource given by a URL
By default, the Flask route responds to the GET requests. However, this preference can be altered by providing methods argument to route() decorator.
In order to demonstrate the use of POST method in URL routing, first let us create an HTML form and use the POST method to send form data to a URL.