怎么把这个 curl 命令用 python requests 搞定
3个回答
展开全部
import httplib
import json
p = { "method" : "test", "params" : [ { "detail" : "Hello_world"} ] }
headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain"}
conn = httplib.HTTPConnection("127.0.0.1", 8081)
conn.request("POST","", json.dumps(p), headers)
import json
p = { "method" : "test", "params" : [ { "detail" : "Hello_world"} ] }
headers = {"Content-type":"application/x-www-form-urlencoded","Accept":"text/plain"}
conn = httplib.HTTPConnection("127.0.0.1", 8081)
conn.request("POST","", json.dumps(p), headers)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询