Fix str encode for request with proxy (Py3)