Last active
February 9, 2021 13:33
-
-
Save fdlk/e32346bb33ed71126d9322226801de15 to your computer and use it in GitHub Desktop.
Ping script for FAIR datapoint home
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib.request | |
import json | |
body = json.dumps({'clientUrl': 'http://localhost/api/fdp'}).encode('utf-8') | |
req = urllib.request.Request('https://home.fairdatapoint.org') | |
req.add_header('Content-Type', 'application/json; charset=utf-8') | |
response = urllib.request.urlopen(req, body) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would be easier using requests, but this is one less dependency