Python http

November 26, 2020

How to do a simple http request in Python.

Warning do not name file http.py, because it will break everything…

Install pydub

pip install urllib3
# python -m pip install urllib3
import urllib3

http = urllib3.PoolManager()
r = http.request('GET', 'http://httpbin.org/robots.txt')
print(r.status)
print(r.data)

Search