1
我願做POST請求使用EmberJS和灰燼數據灰燼數據JSON-RPC請求示例
我怎麼會去用JSON-RPC查詢我的ZABBIX服務器?
在Python中我會做這樣的事情:
HEADERS = {'content-type': 'application/json'}
URL = 'http://zabbix.mydomain.com/zabbix/api_jsonrpc.php'
QHEAD = { "jsonrpc": "2.0"}
pl = QHEAD
pl['id'] = "8"
pl['method'] = "user.login"
pl["params"] = { "user": "ZabbAdmin001", "password": "NunYaBeez.001." }
r = requests.post(URL,headers=HEADERS,data=json.dumps(pl))