Created
March 28, 2016 19:19
-
-
Save ReedJessen/0a6ba6b8bccb96da45cc to your computer and use it in GitHub Desktop.
HelloIPStreet-Python
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 requests | |
import json | |
def hello_world(): | |
""" Hello World! example Concept Search API call | |
Prints a standard response json object when called """ | |
endpoint = 'https://api.ipstreet.com/v1/sandbox/claim_only' | |
headers = {'Authorization': '5AsaMTe6HUypUlAqv3Rw3E6Pvjo4dYL64Rr2z2va'} | |
payload = json.dumps({'raw_text': 'The quick brown fox jumps over the lazy dog'}) | |
r = requests.post(endpoint, headers=headers, data=payload) | |
print(json.dumps(r.json(), sort_keys=True, indent=4, separators=(',', ': '))) | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment