python接口自动化,通过表单形式请求接口
2021-06-04 18:04
标签:rgb sas class names import nbsp nat name data python接口自动化,通过表单形式请求接口 标签:rgb sas class names import nbsp nat name data 原文地址:https://www.cnblogs.com/camillezxl/p/14647146.html#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)
上一篇:javaSE总结未完......
文章标题:python接口自动化,通过表单形式请求接口
文章链接:http://soscw.com/index.php/essay/90510.html