Python Exp 6
Python Exp 6
Introduction to Requests:The requests library is a powerful and widely used HTTP library for
Python. It simplifies sending HTTP/HTTPS requests to web servers, interacting with APIs, and
retrieving web data. Unlike Python’s built-in urllib, requests is more user-friendly and handles
many complexities such as session management, authentication, and JSON encoding/decoding
automatically.
Source Code :
1.For Flask:
C:\Users\T.O. Indora> pip install flask
2.For Request:
C:\Users\T.O. Indora> pip install requests
Output:
1.For Flask:
Collecting flask
Downloading Flask-2.2.2-py3-none-any.whl (95 kB)
|████████████████████████████████| 95 kB 1.2 MB/s eta 0:00:01
Collecting Werkzeug>=2.2.2
Downloading Werkzeug-2.2.2-py3-none-any.whl (232 kB)
|████████████████████████████████| 232 kB 1.3 MB/s eta 0:00:01
Collecting Jinja2>=3.0
Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 1.1 MB/s eta 0:00:01
Collecting itsdangerous>=2.0
Downloading itsdangerous-2.1.1-py3-none-any.whl (15 kB)
Collecting click>=8.0
Downloading click-8.1.3-py3-none-any.whl (98 kB)
|████████████████████████████████| 98 kB 1.3 MB/s eta 0:00:01
Installing collected packages: click, itsdangerous, Jinja2, Werkzeug, flask
Successfully installed Flask-2.2.2 Jinja2-3.1.2 Werkzeug-2.2.2 click-8.1.3 itsdangerous-2.1.1
2.For Request:
Collecting requests
Downloading requests-2.28.1-py2.py3-none-any.whl (62 kB)
|████████████████████████████████| 62 kB 1.2 MB/s eta 0:00:01
Installing collected packages: requests
Successfully installed requests-2.28.1
Conclusion: In this experiment, we successfully installed the requests and Flask packages using
pip. This ensures that the required dependencies are available for developing and running web
applications or making HTTP requests in Python.