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

1 Answer

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.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest