Tommy SUN
Tommy SUN

Reputation: 87

Difference between http:client and Requests

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.

Upvotes: 3

Views: 6245

Answers (1)

Adam Holloway
Adam Holloway

Reputation: 423

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/)

Upvotes: 4

Related Questions