标签:app requests import request pretty turn tty code json
import requests
def get_():
url = "http://127.0.0.1:9200/indextest/_mapping?pretty"
ss = requests.get(url)
print(ss)
print(ss.content)
d = json.loads(ss.content)
print(d)
return d
def post():
url = "http://127.0.0.1:9200/index/type/_mapping?pretty"
res = requests.post(url, data=json.dumps(get_()["index"]["mappings"]), json=d)
print(res)
print(res.content)
标签:app requests import request pretty turn tty code json
原文地址:https://www.cnblogs.com/lajiao/p/11937449.html