F12查看接口路径

F12查看接口路径_第1张图片
F12查看接口路径_第2张图片

import requests,json,unittest
from fenxiao import code_if
import types,string
#http://test.91isv.cn:9081/yueke-crm/dc/user/list.do 端口后更的是/项目名/端口地址
url='http://ct.91link.com:6084/ysk/'#主地址:地址+端口+项目名称
class user1(unittest.TestCase):
def test_UserByPhone(self):
'''根据手机号查询用户信息'''
self.url_UserByPhone=url+'dc/user/queryUserByPhone.do'
self.data={'merchSn':'8168000000002035','userPhone':'15233664455'}#15233664455 17756984258
self.headers = {'Content-Type': 'application/json '}
self.r=requests.post(url=self.url_UserByPhone,data=json.dumps(self.data),headers=self.headers)
#print('UserByPhone',r.json(),sep="\n----\n")
print('UserByPhone', self.r.json())
self.suju=self.r.json()['code']
#print('type',type(self.suju))
#type(x) is types.IntType
print('suju',self.suju)
#self.suju2=int(self.suju)
#print('suju2', type(self.suju2))
self.expected_code=200

你可能感兴趣的:(python,json,java,ajax,php)