I’m getting HTTP status error 0 when accessing one of my Anvil apps. The exception status code is 0 and the content is None.
I am aware of Anvil Docs | Making HTTP requests.
The weird thing is that running the same app on other systems (on the same network) works fine. So a CORS problem seems unlikely.
The call that yields the error is a call to Rollbar:
def send_rollbar_message(msg, level='error'):
payload = {
'access_token': '<redacted>',
'data': {
'environment': anvil.app.branch,
'platform': 'browser',
'framework': 'anvil',
'level': level,
'body': {
'message': {
'body': msg
}
}
}
}
try:
anvil.http.request('https://api.rollbar.com/api/1/item/', method='POST', json=True, data=payload)
except anvil.http.HttpError as e:
print(f'HTTP error {e.status} when calling Rollbar with content {e.content}')
raise
On the system in question (a raspberry pi) I can do a ping to api.rollbar.com just fine.
Any ideas? TIA