Python Examples
# Make an HTTP GET request, return a file-like HTTP response.
def fetch(path):
url = f"https://peer.decentraland.org/{path}"
headers = { "User-Agent": "urllib" } # important on some servers (if empty, 403 Forbidden)
request = urllib.request.Request(url, headers=headers)
response = urllib.request.urlopen(request)
return response# Check the server status:
about = json.load(fetch('about'))
if not about['healthy']:
print("Server not healthy!")
sys.exit(1)Last updated