Beispiel #1
0
    def _test_Post(self):
        url = "https://gateway.test.95516.com/gateway/api/queryTrans.do"
        data = "version=5.0.0&encoding=utf-8&signMethod=01&txnType=00&txnSubType=00&bizType=000000&accessType=0&channelType=07&orderId=20160417090108&merId=777290058110097&txnTime=20160417090108&certId=68759663125&signature=Hyz31eHxPhXnXWSsquV1p%2FI%2BtD4pM9A5OQkPw4xO7Ntrb58eP8xdIMLvtaj%2BeqywBuw7g6w49RoukrQIStYzZ43pQanw5%2F%2F3xzmnn50PiJPYTbxCXd6by1Ct5QVpVbYRdF12ioJvxgoEPhT9kfdQ8lrOikFlInyDR3DTsVInng73lZqVpiFq21Eky0b0M46BiV94vnAtiCpZjpuD%2BycSsmljRgBUvAbrpuS6G7qZCDlRBCeXB%2B4y7%2BoWo%2F07ZFcB0pCqzxUaG822Om49m54%2B86ywUzig8mDGBZ0LbTrwvZV22zE9wlKglQkAH4iL2aZeLqL%2BY4yoaE9rFiKModfuoA%3D%3D"

        res_data = SDKUtil.post(url, data)
        parse_res = parse.parse_qs(res_data)
        if 'merId' not in parse_res:
            raise KeyError
        self.assertEqual(parse_res['merId'][0], '777290058110097')
Beispiel #2
0
 def post(params, url):
     content = SDKUtil.createLinkString(params, False, True)
     respString = SDKUtil.post(url, content)
     resp = SDKUtil.parseQString(respString)
     return resp