python接口自动化,通过表单形式请求接口
2021/4/12 12:25:34
本文主要是介绍python接口自动化,通过表单形式请求接口,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
#coding:utf-8 import xlrd,requests file_name = r"F:\pythonScript\map_dp\data_center\data_config\second_disaster_of_agriculture_and_natural_gas.xls" workbook = xlrd.open_workbook(file_name) sheet1_name = workbook.sheet_names()[0] sheet1 = workbook.sheet_by_name('Sheet1') body = sheet1.cell(1, 8).value.encode('utf-8') print(body) url = "http://uatrgm.mapfarm.com/akat/disaster/agrometeo_disaster/all_agrometeo_disaster_list" headers = {"Authorization": "34qdwwbgf3589xwe2vcf367as4maexvw"} r = requests.get(url=url,headers=headers,params=body) print(r.text)
这篇关于python接口自动化,通过表单形式请求接口的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08有遇到过吗?同样的规则 Excel 中 比Python 结果大
- 2024-03-30开始python成长之路
- 2024-03-29python optparse
- 2024-03-29python map 函数
- 2024-03-20invalid format specifier python
- 2024-03-18pool.map python
- 2024-03-18threads in python
- 2024-03-14python Ai 应用开发基础训练,字符串,字典,文件
- 2024-03-13id3 algorithm python
- 2024-03-13sum array elements python