WebDev Flashcards
1
Q
urllib modules
A
request: open URLs
response: (used internaly)
error: exceptions
parse: useful URL function
2
Q
urllib request
A
resp = urllib.request.urlopen(‘url’)
or use context manager
3
Q
urllib HTTPResponse methods and attributes
A
resp. code - status code
resp. lenght - response lenghts
resp. peek() - preview part of response
resp. read() - read response body as binary
4
Q
urllib parse querystring
A
urllib.parse.urlencode(query_dict)