Flask Web Development with Python Tutorial - 3 - HTTP Methods

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

To simulate POST request on Firefox
1) Open Developer tools (F12)
2) Go to Network tab
3) Reload
4) Right-click page -> Edit and Resend
5) Change GET to POST -> Send
6) A new post request will appear in the Network tab
7) Click it and go to Response tab

ivanyosifov
Автор

if you don't want to use plugin there is simple form:
def bacon():
if request.method == 'POST':
return "Method used: POST"
else:
return '<form action="/bacon" method="POST"><input type="submit" value="submit"/></form>'

Niukasxxl
Автор

Is the Lasagna done yet? Please keep mine LOL.

mog
Автор

You tutorials are the best man. Well done. But I am surprised to see you working on MS Windows!!!

vapon
Автор

Thank you very much for this video! It was very concise and educational for me :)

tymothylim
Автор

Where are your tutorials on using GET and POST methods?

matthewsattam
Автор

i have followed previous video and that urls are working fine for this video url is showing 404 not found error.. what should i do

MrTapan
Автор

copy pasted the code from your github page but it doesnt work.
Not Found

The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.


got it. multiple copies of the server were running.

ambig
Автор

Hi, please how did you do to simulate POST?? thanks in advance.

technethw
Автор

request.method is not working. Using python 2.7.6 . Here is the source code


from flask import Flask , request
web = fl(__name__)
@web.route('/')
def home():
return request.method
if __name__== '__main__':
web.run(debug=True)

radioactiveposts
Автор

please show some mercy towards the keybord

dimensionX
Автор

Stop being lazy, and add some elif statements in there lol. There are other HTTP methods

jeremyford
Автор

i am lost. wtf is get or post ? we will never know ! time to find a tutorial which isn't clickbait.

bloodaxe