Pythonはrequests postで読み込むjsonの方法を使用します。

844 ワード

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 JSONhttp://www.runoob.com/python/python-json.html