1
mengzhuo 2013-05-20 01:55:19 +08:00
确实囧得很
json模块不行吗? |
2
Jet 2013-05-20 04:22:13 +08:00
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) 不知道理解是否正确。 |
3
hit9 2013-05-20 09:12:08 +08:00
In [1]: import requests
In [2]: data = { ...: 'method': 'test', ...: 'params': [ ...: {'detail':'hello world'} ...: ] ...: } In [3]: requests.post("http://example.com",data=data) Out[3]: <Response [200]> |
4
xyly624 2013-05-20 13:41:44 +08:00
|
5
zhengjian 2017-07-15 01:37:46 +08:00 1
推荐一个网站: https://curl.trillworks.com/
|