jeudi 11 mai 2017

Ember Data JSON-RPC requests Example

I would like to do Post requests to my zabbix server using EmberJS and ember-data

How would I go about querying with JSON-RPC ?

In python I'd do something like this:

HEADERS = {'content-type': 'application/json'}
URL = 'http://ift.tt/2r5viby'
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))




Aucun commentaire:

Enregistrer un commentaire