Check all our Python Courses at:
https://rmotr.com
Introduction to Python online course
Advanced Python Programming Online Course
Web Development with Django Online Course
Flask Tutorial - Step by
Step
CLIENT - SERVER
SERVERCLIENT
Our Flask
webapp
SERVERCLIENT
Our Flask
webapp
Client Request
SERVERCLIENT
Our Flask
webapp
Client Request
Server Response
CLIENT SERVER
Our Flask
webapp
Client Request
Server Response
Flask Tutorial - Step by
Step
HTTP
Flask Tutorial - Step by
Step
🙌 HTTP 🙌
HTTP
HTTP is a stateless, text-
based protocol
SERVERCLIENT
Our Flask
webapp
🤔
GET /intro-to-python HTTP/1.1
Host: rmotr.com
Accept: text/html
Example: Browsing
http://rmotr.com
Client Request
SERVERCLIENT
Our Flask
webapp
Client Request
GET /intro-to-python HTTP/1.1
Client Request
GET /intro-to-python HTTP/1.1
PATH
Client Request
GET /intro-to-python HTTP/1.1
HTTP
VERSION
Client Request
GET /intro-to-python HTTP/1.1
HTTP
METHOD
HTTP Methods
GET /intro-to-python HTTP/1.1
POST: Create resource
PUT: Update resource
PATCH: Update resource
DELETE: Delete resource
HEAD: Extras
OPTIONS: Extras
Client Request
GET /tweet/3123 HTTP/1.1
POST /tweet HTTP/1.1
DELETE /tweet/3123 HTTP/1.1
Client Request
SERVERCLIENT
Our Flask
webapp
Server Response
HTTP/1.1 200 OK
<html>
<h1>Introduction to Python Programming</h1>
</html>
Server Response
HTTP/1.1 200 OK
<html>
<h1>Introduction to Python Programming</h1>
</html>
Server Response
HTTP
VERSION
HTTP/1.1 200 OK
<html>
<h1>Introduction to Python Programming</h1>
</html>
Server Response
BODY
HTTP/1.1 200 OK
<html>
<h1>Introduction to Python Programming</h1>
</html>
Server Response
STATUS CODE
STATUS CODES
2XX: SUCCESS
3XX: REDIRECTION
4XX: CLIENT ERROR
5XX: SERVER ERROR
EXAMPLE
bit.ly/rmotr-flask-tutorial
CLIENT
rmotr.com
CLIENT
rmotr.com
CLIENT
rmotr.com
HTTP/1.1 400 Bad Request
OTHER EXAMPLES
POST /tweet HTTP/1.1
HTTP/1.1 404 Not Found
OTHER EXAMPLES
GET /XYZ HTTP/1.1
https://en.wikipedia.org/wiki/List_of_HTTP_s
tatus_codes
MORE STATUS CODES
Flask Tutorial - Step by
Step
HTTP HEADERS
Headers will allow Clients and
Servers to include additional
information
HTTP HEADERS
HTTP HEADERS
Can be included in Requests
and Responses
GET /intro-to-python HTTP/1.1
Host: rmotr.com
User-Agent: Mozilla/5.0
Accept: text/html
Accept-Encoding: gzip
Request with Headers
HTTP/1.1 200 OK
Server: Apache
Content-Type: text/html
Content-Length: 16824
Response with Headers
<html>
<h1>rmotr.com</h1>
</html>

Introduction to HTTP - Hypertext Transfer Protocol