New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write inputs using POST requests. #194
Comments
Your problem is probably located in the input_controller around line 207. There you find this code: It is assumed that you send the nodeid with your data.
Hoping it will solve your problem. |
@euqip Thanks a lot for your reply. I'll be trying your suggested changes soon. This is what i'm trying to acheive: And this is my C code: int main(void) curl_global_init(CURL_GLOBAL_ALL); if(easyhandle) { curl_easy_cleanup (easyhandle); I just wanted to know if the present emoncms code for bulk data handles POST requests as well. |
Noramlly the BULK process handles the gets and the posts. The documentation is given in the code:
But to send json data , the sender needs to be identified. The identification may be done with the session created after login when using HTML interface. The JSON data sent without a session are attributed to a specific user with the provides WRITEAPIKEY the API key test is done already in the index file, with following code:
If you add the write apikey in the string sent in the POST or in the GET, you will probably succeed. replace apikey_value with your own apiwrite key, and try it with your favorite browser. with the bulk process, the node id seems to be the second data item, item[1]. You will see the result in the emoncms Input interface, with new data sent from node 16. |
Hi,
I'm trying to update my emoncms inputs from a C program using libcurl. I was just wondering if there was a way to get the post.json to accept POST requests instead of GET requests. I wanted to avoid the problem of having to encode the JSON data before a GET request when using CURL.
Is there a simple way to implement this?
I'm quite a novice to php. Please help.
Thanks.
The text was updated successfully, but these errors were encountered: