Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between http:client and Requests

Tags:

python

postman

In Postman, while I want to change my code from 'curl" to "python", there are two options, one is called "http.client(python3)", and the other one is called requests. I'm trying to write a script to call Restful api in python, and i use pycharm to try both of the options. The first one doesn't work and the second one works, and i can successfully get access_token. Could someone explain whats the difference between the two, and I'm new to python btw.

like image 636
Tommy SUN Avatar asked Jul 13 '26 08:07

Tommy SUN


1 Answers

http.client is the python 3 standard library (batteries included) way to make rest calls

Requests is a popular third party library (http://docs.python-requests.org/en/master/) that is commonly used to make calls. You'll need to install it in order to use it (http://docs.python-requests.org/en/master/user/install/)

like image 102
Adam Holloway Avatar answered Jul 21 '26 16:07

Adam Holloway



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!