python单个接口测试记录

发布时间:2020-08-05 12:35:09 作者:知止内明
来源:网络 阅读:597
#encoding=utf-8
import chardet
import urllib
import requests
import json
import os
import hashlib

        '''校验短信验证码到接口'''
def checkVCodeBeforeLoginNew():
    head = {
            'Content-Type': "application/json",
            'X-Toon-User-ID': '9000037',
            'X-Toon-User-Token': '16c9f975-',
            'X-Toon-User-Agent': 'platform'
        }
    print "校验短信验证码到接口"
    data = json.dumps({"channel":"string","code":"string","deviceName":"string","deviceToken":"string","fromWhere":"string","idfa":"string","imei":"string","macAddress":"string","mobile":"21410665218","mobileVerfiyCode":"1111","teleCode":"0086","type":0,"uuid":"34545"})
    r = requests.post('{ip}', data= data,headers=head)
    print r.status_code
    print r.text
    #print type(r.json())
    #print str(r.json())

校验短信验证码到接口
200
{"meta":{"code":0,"message":"success"},"data":{"userId":9000037,"userName":"21410665218","token":"16c9f975-d5d7-4cef-9a12-fb8dc5a81792","personToken":"2f06e1c8f8372f1d2e87e89334177d28bc5453c80c53664c2ffd32700d84b26595e646b2c87a7ab1cc121271eecae42891167a68e65b5d573fb87eb5c446e3e3458d74acee38ef21dfacc4eff32140235ad96ba634ab66b686b2946ee45f726b","status":"1"}}

推荐阅读:
  1. soapUI+groovy 接口测试之部分groovy使用记录
  2. 为什么要做接口测试

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

python 单个 接口

上一篇:FFmpeg avcodec_send_packet函数错误定位

下一篇:IOS学习之 UITabBar

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》