#!/usr/bin/python # encoding:utf-8 import urllib2, json, urllib dict ={} dict['key'] = '您申请的key,在会员中心->我的数据->对应数据的下方'; dict['bas64String'] = ' /9j/4AAQSk.....'; dict['side'] = '1'; url = "http://v.1dq.com/api/c9 + "?" + urllib.urlencode(dict) result = urllib2.urlopen(urllib2.Request(url)) jsonarr = json.loads(result.read()) # 输出错误码 print jsonarr["error_code"]