V
V
veselkovna2020-07-17 09:45:30
Python
veselkovna, 2020-07-17 09:45:30

How to send http requests to a proxy server?

Good afternoon. unable to authorize on the proxy server of the organization, when executing the code returns an error:

Traceback (most recent call last):
File "C:\test\http.py", line 1, in
import requests
File "C:\Python34\lib\site -packages\requests\__init__.py", line 43, in
import urllib3
File "C:\Python34\lib\site-packages\urllib3\__init__.py", line 7, in
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
File "C:\Python34\lib\site-packages\urllib3\connectionpool.py", line 11, in
from .exceptions import (
File "C:\Python34\lib\site-packages\urllib3\exceptions.py", line 2 , in
from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
File "C:\Python34\lib\site-packages\urllib3\packages\six.py", line 199, in load_module
mod = mod._resolve()
File "C :\Python34\lib\site-packages\urllib3\packages\six.py", line 113, in _resolve
return _import_module(self.mod)
File "C:\Python34\lib\site-packages\urllib3\packages\six. py", line 82, in _import_module
__import__(name)
File "C:\test\http.py", line 2, in
from requests.auth import HTTPProxyAuth
File "C:\Python34\lib\site-packages\requests\auth .py", line 19, in
from .compat import urlparse, str, basestring
File "C:\Python34\lib\site-packages\requests\compat.py", line 59, in
from urllib.request import parse_http_list, getproxies, proxy_bypass, proxy_bypass_environment, getproxies_environment
File "C:\Python34\lib\urllib\request .py", line 88, in
import http.client
ImportError: No module named 'http.client'; 'http' is not a package

5f1148b81d19c096152275.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dr. Bacon, 2020-07-17
@veselkovna

well, by default, "http" is a package, you don't need to name your file with the same name.

D
Dimonchik, 2020-07-17
@dimonchik2013

ImportError: No module named 'http.client'; 'http' is not a package

correct

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question