[+] Create RequestConfiguration.create
This commit is contained in:
@@ -9,3 +9,4 @@ pytz==2020.4
|
||||
six==1.15.0
|
||||
tornado==6.1
|
||||
tzlocal==2.1
|
||||
requests==2.25.0
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import requests
|
||||
|
||||
|
||||
class RequestConfiguration:
|
||||
headers = []
|
||||
headers = {}
|
||||
payload = {}
|
||||
|
||||
def __init__(self, url, method="GET"):
|
||||
self.url = url
|
||||
self.method = method
|
||||
|
||||
# Create and execute http request
|
||||
def create(self):
|
||||
return requests.request(self.method, self.url, headers=self.headers, data=self.payload)
|
||||
|
||||
Reference in New Issue
Block a user