Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

urllib3 part of requests package?

I've recently used requests.get to read SharePoint details like below:

r = requests.post(sharepoint_contextinfo_url, auth=auth, headers=headers, verify=False)

Code worked as expected. But received the warning Unverified HTTPS request is being made. Adding certificate verification is strongly advised.

Then, I used requests.packages.urllib3.disable_warnings() to disable the warnings.

My question is requests uses urllib3 to disable warnings? I was in assumption that requests and urllib3 are two different libraries

If urllib3 is part of requests (which I don't think so) then what are all the other urllib3 can be used?

I am new to Python. I may be wrong. Please clarify

like image 644
Karthick Raju Avatar asked Oct 22 '25 20:10

Karthick Raju


1 Answers

Urllib3 is an independant package from request, Request is using (or better say built on top of) urllib3 and urllib3 can be used on its own.

The reason why requests exists is to make HTTP(S) requests a lot more painless for the developers.

  • urllib3 GitHub repo
  • Requests website
like image 77
WiGeeky Avatar answered Oct 24 '25 10:10

WiGeeky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!