Skip to content

Instantly share code, notes, and snippets.

@fdlk
Last active February 9, 2021 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fdlk/e32346bb33ed71126d9322226801de15 to your computer and use it in GitHub Desktop.
Save fdlk/e32346bb33ed71126d9322226801de15 to your computer and use it in GitHub Desktop.
Ping script for FAIR datapoint home
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)
@fdlk
Copy link
Author

fdlk commented Feb 9, 2021

Would be easier using requests, but this is one less dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment