Added a simple client for python. The URLs will need to be modified when the API is up and running on the server

This commit is contained in:
ibrahimahmed443
2014-04-15 14:53:46 +05:00
committed by Muneeb Ali
parent 5a733c22ef
commit 1e11fe1934

View File

@@ -0,0 +1,18 @@
import json
import requests
PROFILE_URL = 'http://localhost:5003/v1/people/'
SEARCH_URL = 'http://localhost:5003/v1/people-search/'
ACCESS_TOKEN = '<ACCESS_TOKEN>'
#Profile API
query = 'muneeb'
url = PROFILE_URL + "id=" + query
resp = requests.get(url)
print resp.text
#SEARCH API
query = 'john '
url = SEARCH_URL + ACCESS_TOKEN + "?keywords=" + query
resp = requests.get(url)
print resp.text