Skip to content

Commit 2c53338

Browse files
authored
Create integration.py
1 parent 23ab1bb commit 2c53338

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/integration.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import requests
2+
3+
class Integration:
4+
def __init__(self, api_url):
5+
self.api_url = api_url
6+
7+
def fetch_data(self, endpoint):
8+
response = requests.get(f"{self.api_url}/{endpoint}")
9+
return response.json()
10+
11+
def send_data(self, endpoint, data):
12+
response = requests.post(f"{self.api_url}/{endpoint}", json=data)
13+
return response.status_code

0 commit comments

Comments
 (0)