Decode received bytes according to content type encoding
The received bytes have to be decoded with the correct character encoding to be interpreted as text:
urllib.urlopen() will return a response object, which can be handled similar to a file.
response.code represents the http return value. 200 is OK, 404 is NotFound, etc.
response.readlines() can be used to read the actual html file returned from the request. These methods operate similarly to
The module has been updated for Python 3.x, but use cases remain basically the same.
urllib.request.urlopen will return a similar file-like object.
To POST data pass the encoded query arguments as data to urlopen()