Questions tagged [urllib3]

`urllib3` is a 3rd-party Python HTTP library with thread-safe connection pooling, file post, and more.

urllib3 is a library for python 2 and 3 providing a HTTP API with thread-safe connection pooling, file posting support, redirection handling and retries.

Documentation can be found at https://urllib3.readthedocs.io/en/latest/

760 questions
0
votes
0 answers

Error 10054 when connecting google service

I tried to connect to google api and got this error requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: /speech-api/v1/recognize?xjerr=1&client=chromium&lang=ru-RU (Caused by…
0
votes
2 answers

Have an example of gzipped attachment decoding with Python's urllib3 or requests?

I just need an example ... I have working code with both urllib3 and requests to download a page with an attached gzipped file (of XML). I don't see how to get this attachment with either package; all I get is the HTML page but not the attached…
Mark McWiggins
  • 621
  • 6
  • 20
0
votes
2 answers

Connecting streams in Python

I have python3.3 I have a Response object from urllib3 (which has a stream() method, which returns generator) I have a file I want to write the data to What is the most idiomatic way of writing data from (1) into (2)? I can use list comprehension…
JimiDini
  • 2,039
  • 12
  • 19
0
votes
0 answers

Which response goes with which request?

I'm using Python with OpenERP 7. I fire requests to partners using urllib3. Some of these requests may be asynchronous. So I've built a little asyncore server to wait for responses. But the thing is, the server cannot know which response goes with…
Yann
  • 134
  • 1
  • 11
0
votes
2 answers

Python: Surpass SSL verification with urllib3

Connectiing to SSL server is throwing an error: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed I'm using this urllib3 python library for connecting to server, using this…
Jack
  • 1,521
  • 4
  • 21
  • 29
0
votes
1 answer

How to authenticate with requests module using a trust store?

I am currently writing a python language plugin for a compiler I have written that automates http calls for a RESTful API. I have managed to get the login/authentication working using the socket and ssl modules, but this low-level approach seems to…
0
votes
1 answer

How to make a http request with cookies using urllib3 Python library?

Possible Duplicate: Python urllib3 and how to handle cookie support? I am trying to retrieve source code from a webpage with an already issued cookie and write the source code to a txt file. If I remove the cookies=cookie portion I can retrieve…
Kyle
  • 3
  • 1
  • 3
0
votes
1 answer

'HTTPConnectionPool' object has no attribute 'get_url'

this is my codes: import urllib3 url='http://www.google.com/' http_pool = urllib3.connection_from_url(url) content = http_pool.get_url('/') print (content.info()) print ('----------------------------') page = content.read() print…
eternalblaze
  • 57
  • 1
  • 6
0
votes
1 answer

Datamining Multithreading vs Multiprocessing

I wrote and rewrote my little python application to a point where my current python skills aren't enough. I started with a single threaded application with Beautiful Soup as the parser, changed to lxml. Made the script multi-threaded, i discovered…
Cango
  • 100
  • 7
-1
votes
1 answer

When importing libraries I get ImportError in python3.10.11 (IDE -PyCharm)

This error appears every time I try importing requests and other libraries: C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python.exe C:\Users\Administrator\PycharmProjects\pythonProject11\main.py Traceback (most recent call…
-1
votes
1 answer

How does python access the apiClient of k8s through socks5 proxy

Accessing k8s apiclient is successful without using a proxy, as follows: configuration = client. Configuration() configuration.verify_ssl = False configuration.host = "xxx" configuration.api_key = {"authorization": "Bearer " + self.token} c =…
-1
votes
1 answer

get status_code for http.urlopen

How can I print the status code for this response? (eg 200/401 etc) resp = http.urlopen('POST', 'https://api.bitbucket.org/2.0/repositories/6789oh', headers=headers, body=json.dumps(data)) print(str(resp.data)) I…
x89
  • 2,798
  • 5
  • 46
  • 110
-1
votes
1 answer

Unable to make requests.packages.urllib3 work

I am having an issue trying to use requests.packages.urllib3.exception, but i keep getting "could not be resolved". It used to work on another project, but i tried to merge this project with a PySide6 project and it wont work anymore. The code is…
Dave
  • 39
  • 5
-1
votes
1 answer

How do I fix the ImportError?

So here is the import section: from urllib3.packages import six from .packages.six import HTTPConnection as _HTTPConnection from .packages.six import HTTPException The Import Error raised at Line 2 is: ImportError: cannot import name…
Raj1969
  • 21
  • 6
-1
votes
2 answers

Get the content of PDF from a URL with Python 3 without download it

Is there a way to read the first page of a PDF document from a URL without saving it locally? I need to read a request for a PDF document on the website. In the following, you will find the code that I tried to execute. The code works well with some…
Olfa
  • 1