Skip to content

Commit 913de4b

Browse files
committed
SW-3825
1 parent d6bbdd5 commit 913de4b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • whatsapp_api_client_python

whatsapp_api_client_python/API.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,18 @@ def request(
7878
url = url.replace("{{idInstance}}", self.idInstance)
7979
url = url.replace("{{apiTokenInstance}}", self.apiTokenInstance)
8080

81+
headers = {
82+
'User-Agent': 'GREEN-API_SDK_PY/1.0'
83+
}
84+
8185
try:
8286
if not files:
8387
response = self.session.request(
84-
method=method, url=url, json=payload, timeout=self.host_timeout
88+
method=method, url=url, json=payload, timeout=self.host_timeout, headers=headers
8589
)
8690
else:
8791
response = self.session.request(
88-
method=method, url=url, data=payload, files=files, timeout=self.media_timeout
92+
method=method, url=url, data=payload, files=files, timeout=self.media_timeout, headers=headers
8993
)
9094
except Exception as error:
9195
error_message = f"Request was failed with error: {error}."

0 commit comments

Comments
 (0)