Created
August 9, 2017 17:03
-
-
Save xadahiya/b7a8aa7f986e0feeb3ceacbb7b7dee76 to your computer and use it in GitHub Desktop.
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
""" | |
Example from the README | |
""" | |
def main(): | |
the_iri_of_the_resource = 'http://www.markus-lanthaler.com/hydra/event-api/events/102' | |
from hydra import Resource, SCHEMA | |
res = Resource.from_iri(the_iri_of_the_resource) | |
get_event = res.find_suitable_operation(None, None, SCHEMA.Event) | |
resp, body = get_event() | |
print(body) | |
assert resp.status == 201, "%s %s" % (resp.status, resp.reason) | |
new_event = Resource.from_iri(resp['location']) | |
print(new_event) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment