Category : oop

I’ve tested this snippet and get the result as expected: import requests import json url = ‘https://example.com/getlistitem’ headers= { ‘User-Agent’: ‘Mozilla/5.0’, ‘Referer’: ‘http://banggia.tvs.vn/’, ‘content-type’: ‘text/json’, ‘Content-Type’: ‘application/json;charset=utf-8’ } res=requests.get(url, headers = headers, timeout= 30).json() print(res) Now, I manage to convert it into class as this: class getvps(): url = ‘https://example.com/getlistitem’ headers= { ‘User-Agent’: ‘Mozilla/5.0’, ‘Referer’: ..

Read more