Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created April 28, 2015 11:23
Show Gist options
  • Save kuc-arc-f/11dec823ab8040ef0b11 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/11dec823ab8040ef0b11 to your computer and use it in GitHub Desktop.
agri-blog4-1a-python
def get_master(self, sId ):
ret={}
clsConst = com_appConst.appConstClass()
headers = {
"X-Parse-Application-Id": clsConst.mParse_APP_ID ,
"X-Parse-REST-API-Key": clsConst.mParse_REST_ID ,
"Content-Type": "application/json"
}
dtParam = {'mc_id': int(sId) };
params = urllib.urlencode({"where":json.dumps(dtParam)})
try:
r = requests.get('https://api.parse.com/1/classes/MsObject?' +params, headers=headers , timeout=30)
print r.status_code
dRest = r.json()
nCt= len(dRest["results"])
print nCt
if(nCt > 0):
print dRest["results"][0]
ret=dRest["results"][0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment