您可以像@roippi一样使用urllib:
import urllib2data = '{"nw_src": "10.0.0.1/32", "nw_dst": "10.0.0.2/32", "nw_proto": "ICMP", "actions": "ALLOW", "priority": "10"}'url = 'http://localhost:8080/firewall/rules/0000000000000001'req = urllib2.Request(url, data, {'Content-Type': 'application/json'})f = urllib2.urlopen(req)for x in f: print(x)f.close()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)