How to Send POST Request Using urllib Only in Python3

Jumped into Python, having the urllib, urllib2 and urllib3 for Python3; Unfortunate for me as I’m using Python3 there is no urllib2for it and POST requests in most places I’ve seen it used are used with urllib2. I had no choice than to deal with what I have, digging into Python documentary site I figured out how to send POST requests with urllib only. Below is a sample code

data must be a bytes object specifying additional data to be sent to the server, or None

Turning the dictionary data into URL data using urlencode, I then encoded the string and turned it into bytes then sent! 🙂 handler.read() returns bytes data also so I decoded into utf-8 string and do what I want 🙂