1
0
Fork 0
Commit graph

2 commits

Author SHA1 Message Date
Daniele Polizzi
96eab8ed1d
Update __init__.py
I changed the import statement from request import Session to import requests because in the original the Session class is the only class imported from the request library. In this case, it is more efficient to import the whole library with import requests and use requests.Session() instead of Session() and added various code comments

Instead of having a separate dictionary, I created a headers dictionary and used the update() method to update the session header.

The create() function returns the results of a request made to a website as a JSON dictionary using the .json() method. However, you don't need to import the json library explicitly because the json() function is a method of the Response object returned by session.post(). In other words, the .json() method does the json decoding for us, so we don't need to use the json module's json()
2023-04-26 15:25:09 +02:00
t.me/xtekky
dbfeab7242 code refractoring 2023-04-22 13:47:03 +01:00