python单个接口测试记录

#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"}}










本文转自 知止内明 51CTO博客,原文链接:http://blog.51cto.com/357712148/2051411,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值