Python 使用 requests post 读取的 json 的方法

def create_module_index(module_name):
    url = "http://localhost:9200/{}".format(module_name.lower())
    with open("./create_index.json", "r", encoding="utf-8") as file_object:
        json_obj = json.load(file_object)
        rep = session.put(url, json=json_obj)
        print(rep.status_code)
        print(rep.text)

1、python对json的操作总结
https://www.cnblogs.com/loleina/p/5623968.html

2、Python JSON
http://www.runoob.com/python/python-json.html


你可能感兴趣的:(Python基础)