Hi There,
I'm trying to attach a data source to emoncms via API. So I post something like this:
http://192.168.178.23/emoncms/input/post.json?json={power:200}&apikey=671b341330a7b1a4c20bf8ae7dd1faf1&time=12345677890
The problem is, that when creating this URL automatically it is encoded like this
http://192.168.178.23/emoncms/input/post.json?json=%7Bpower%3A200%7D&api...
I thought the browser might do the same but I'm not sure. But when posting the last URL, emoncms tells me that theres no json-part in the url.
An other question: Why can't I just send the data in the request body? "Posting" Data via URL isn't good practice...
Bests
Pascal
Post json to emoncms
Submitted by Guest on Thu, 24/07/2014 - 05:55Hi There,
I'm trying to attach a data source to emoncms via API. So I post something like this:
http://192.168.178.23/emoncms/input/post.json?json={power:200}&apikey=671b341330a7b1a4c20bf8ae7dd1faf1&time=12345677890
The problem is, that when creating this URL automatically it is encoded like this
http://192.168.178.23/emoncms/input/post.json?json=%7Bpower%3A200%7D&api...
I thought the browser might do the same but I'm not sure. But when posting the last URL, emoncms tells me that theres no json-part in the url.
An other question: Why can't I just send the data in the request body? "Posting" Data via URL isn't good practice...
Bests
Pascal