随笔分类 -  接口

摘要:1. 新建project $ httprunner startproject demo 2.编写数据存放,如数据驱动: username,password test1,111111 test2,222222 test3,333333 然后在 YAML/JSON 测试用例文件中,就可以通过内置的 pa 阅读全文
posted @ 2022-08-04 22:10 不带R的墨菲特 阅读(265) 评论(0) 推荐(0) 编辑
摘要:前言: httprunner 底层request还是依赖于request 库;所以你如果清楚文件上传使用代码实现逻辑,理解起来就很简单 这里还是再重复解释一次它的实现原理再来解释在httprunner 的使用方式: 感兴趣去我这篇源码解读博客去看:https://www.cnblogs.com/Su 阅读全文
posted @ 2021-07-19 11:42 不带R的墨菲特 阅读(329) 评论(0) 推荐(0) 编辑
摘要:先说下多字段多文件的上传: # 多个字段文件上传,org explain format is: ("filename", "fileobject", "content-type", "headers") { "field1" : ("filepath中的文件名称", open("filePath1" 阅读全文
posted @ 2020-11-10 14:20 不带R的墨菲特 阅读(402) 评论(0) 推荐(0) 编辑
摘要:# coding=utf-8 # urllib_get_file=urllib.request.urlretrieve(url=None,filename="test.zip") # basic usage of urllib from urllib import request url = "ht 阅读全文
posted @ 2020-02-13 00:23 不带R的墨菲特 阅读(136) 评论(0) 推荐(0) 编辑
摘要:核心代码: for i in range(10): print('\r' + '>' * i, end='') 示例展示以搜狗输入法为例: import timeimport requestsimport osfor i in range(10): print('\r' + '>' * i, end 阅读全文
posted @ 2020-02-12 18:19 不带R的墨菲特 阅读(329) 评论(0) 推荐(0) 编辑
摘要:处理multipart/form-data 的java serverlet请求接口通过python实现 记住不要在头加:"Content-Type":"multipart/form-data"不然会报错 import requestsdt={"file":{},"message": "duotou" 阅读全文
posted @ 2019-11-29 14:21 不带R的墨菲特 阅读(2544) 评论(0) 推荐(1) 编辑
摘要:http://www.cnblogs.com/wade-xu/p/4236295.html 阅读全文
posted @ 2019-04-26 15:12 不带R的墨菲特 阅读(422) 评论(0) 推荐(0) 编辑
摘要:def upload(): r = requests.post( url='http://upload.renren.com/upload.fcgi?pagetype=addpublishersingle&hostid=967004081&' 'callback=window.parent.hand 阅读全文
posted @ 2019-04-14 23:10 不带R的墨菲特 阅读(412) 评论(0) 推荐(0) 编辑
摘要:ddt官方help 文档:https://ddt.readthedocs.io/en/latest/example.html 阅读全文
posted @ 2019-04-13 21:16 不带R的墨菲特 阅读(547) 评论(0) 推荐(0) 编辑
摘要:https://github.com/githublitao/api_automation_test 阅读全文
posted @ 2019-04-12 23:49 不带R的墨菲特 阅读(1184) 评论(0) 推荐(0) 编辑
摘要:想了很久,闲来无事,今天想了下还是总结了下写下来,部分参考官方源码理解,还有就是这么久的理解, 如果觉得有帮助请记得点赞 先讲下接口url组成拿后台服务为例 通常一个后台请求url格式: http://www.gamma.tools.hw.com/PipelineSvr/v1/exeplan?pla 阅读全文
posted @ 2019-03-15 23:47 不带R的墨菲特 阅读(182) 评论(0) 推荐(0) 编辑
摘要:import requests import json from requests import session import urllib3 import os urllib3.disable_warnings() conf_path = os.path.abspath("../api/reque 阅读全文
posted @ 2019-03-15 23:45 不带R的墨菲特 阅读(1629) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示