import requests
posturl = 'http://localhost:8086/write?db=jmeter'
str_val = """{"code":0,"msg":"success","data":null}"""
# influxdb 的字段类型需要一致
# data = 'response,httpCode=200 responseData="{}",requestHeaders="1",responseHeaders="1" '.format(str_val)
# data = '''response,httpCode=200 responseData="{}",requestHeaders="1",requestData="1",responseHeaders="1",test="1" '''.format(str_val)
data = '''response,requestHeaders=request_headers requestData="data",httpCode=200,responseHeaders="response_headers",responseData="{}" '''.format(str_val)
# data = 'response,httpCode=200 requestHeaders="1",responseHeaders="1" '
response = requests.post(posturl, data=data)
网友评论