Beispiel #1
0
 def _processResponse(self, res):
     if res.status == 200:
         return str(res.body)
     if res.status == 303:
         return ''
     else:
         sh.printObject(res)
         raise Exception("Request Error %d" % res.status + res.errors)
Beispiel #2
0
 def _processResponse(self, res):
     if res.status == 200:
         return str(res.body)
     if res.status == 303:
         return ''
     else:
         print sh.printObject(res)
         raise Exception("Request Error %d" % res.status + res.errors)
Beispiel #3
0
def printDict(handler):
    html = str(handler())
    # 此功能仅对后台管理员开放,以免影响正式调用api时的返回结果
    if sh.session.is_admin and html and html[0] == '{' and html[-1] == '}':
        html = sh.printObject(sh.loadsJson(html), not_user_column_names=True)
    return html