Linest
April 8, 2023, 9:15pm
1
For some reasons replit blocks requests from sellix, when i try sending request from my pc “localhost” it works fine;
Code:
headers = {
"Authorization": f"Bearer {api_token}",
"Content-Type": "application/json",
"X-Sellix-Merchant": "ShinyTool"
}
invoice = requests.get(
"https://dev.sellix.io/v1/orders/XXXX-XXXX-XXXX",
headers=headers
)
return invoice
9pfs1
April 8, 2023, 9:16pm
2
What happens when you try to send a request to that URL?
1 Like
Linest
April 8, 2023, 9:19pm
4
It gives me an error:
565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='dev.sellix.io', port=443): Max retries exceeded with url: /v1/orders/f0c330-xxxxxxxxxxxxx(Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f1e8946e380>: Failed to establish a new connection: [Errno 111] Connection refused'))
hey, it looks like your connection is refused because maybe you don’t have a web agent?
Try adding this to your headers:
headers = {
"Authorization": f"Bearer {api_token}",
"Content-Type": "application/json",
"X-Sellix-Merchant": "ShinyTool",
"User-Agent": "Mozilla/2.0",
"X-Requested-With": "XMLHttpRequest",
}
Linest
April 8, 2023, 11:56pm
6
Coder100:
headers = {
"Authorization": f"Bearer {api_token}",
"Content-Type": "application/json",
"X-Sellix-Merchant": "ShinyTool",
"User-Agent": "Mozilla/2.0",
"X-Requested-With": "XMLHttpRequest",
}
Hey, nope its not the issue, for some reasons its perfectly working on my localhost and on other host platforms, but not in replit
yeah, maybe the api blacklists replit? Try doing kill 1
in the shell
1 Like
Linest
April 9, 2023, 12:03am
8
Hey seems to work, thanks, could you check my new topic with new issue please, and hlep me
sure, don’t forget to mark this as the solution!
where is the other issue?
9pfs1
April 9, 2023, 1:04am
12
That’s about something different, why quote it here?
system
Closed
April 16, 2023, 1:05am
13
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.