mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-01-12 22:43:42 +08:00
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:
committed by
Muneeb Ali
parent
5a733c22ef
commit
1e11fe1934
@@ -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
|
||||
Reference in New Issue
Block a user