Created
May 11, 2021 17:33
-
-
Save HassenIO/55981812f8101a77f52498f231adc788 to your computer and use it in GitHub Desktop.
Understanding PIP [blog article]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.request import urlopen, Request | |
url = "https://swapi.dev/api/people/42/" | |
httprequest = Request(url, headers={"Accept": "application/json"}) | |
with urlopen(httprequest) as response: | |
print(response.status) | |
print(response.read().decode()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment