Skip to content

Commit 80afc1c

Browse files
authored
Merge pull request #39 from TransposeData/user/krtbgb/tra-2448
TRA-2448: add request source to request headers for all API calls
2 parents 0ebd875 + 9117782 commit 80afc1c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

transpose/src/api/sql/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def query(self,
1717
# build headers
1818
request_headers = {
1919
'x-api-key': self.super.api_key,
20+
'x-request-source': 'python-sdk',
2021
'Accept': 'application/json',
2122
}
2223

@@ -49,6 +50,7 @@ def schema(self) -> dict:
4950
# build headers
5051
request_headers = {
5152
'x-api-key': self.super.api_key,
53+
'x-request-source': 'python-sdk',
5254
'Accept': 'application/json',
5355
}
5456

@@ -73,6 +75,7 @@ def generate_query(self, text: str, chain: str='ethereum') -> dict:
7375
# build headers
7476
request_headers = {
7577
'x-api-key': self.super.api_key,
78+
'x-request-source': 'python-sdk',
7679
'Accept': 'application/json',
7780
}
7881

transpose/src/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def perform_authorized_request(self, model: type, endpoint: str, api_key: str=No
9292
# build the request
9393
request_headers = {
9494
'x-api-key': api_key if api_key else self.api_key,
95+
'x-request-source': 'python-sdk',
9596
'Accept': 'application/json',
9697
}
9798

@@ -131,6 +132,7 @@ def perform_authorized_request(self, model: type, endpoint: str, api_key: str=No
131132
# build the request
132133
request_headers = {
133134
'x-api-key': api_key if api_key else self.api_key,
135+
'x-request-source': 'python-sdk',
134136
'Accept': 'application/json',
135137
}
136138

0 commit comments

Comments
 (0)