![]() To handle both GET and POST requests, we add that in the decorator app.route() method. Save the following script as login.html 1 To demonstrate the use of a POST method in a URL route, first let us create an HTML form and use the POST method to send form data to the URL. Related course: Python Flask: Create Web Apps with Flask Flask HTTP Methods Formīy default, the Flask route responds to GET requests.However, you can change this preference by providing method parameters for the route () decorator. Replace all current representations of the target resource with uploaded content.ĭeletes all current representations of the target resource given by the URL. Same as GET method, but no response body. The data received by the POST method is not cached by the server. Used to send HTML form data to the server. A GET message is send, and the server returns data The following table summarizes the different http methods: Request Http protocol is the basis for data communication in the World Wide Web.ĭifferent methods for retrieving data from a specified URL are defined in this protocol. Flask HTTP methods, handle GET & POST requestsįlask has different decorators to handle http requests. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |