Posting to Thingspeak
I searched the forums and internet and was surprised that I could not find examples of any Qt apps posting to Thingspeak. Did I miss some helpful examples somewhere?
Thanks, I'm quite new to Qt and slowly learning so I was just looking for some examples as I hadn't done any networking tasks with Qt yet.
It looks as though I should use QNetworkAccessManager and then is it as simple as following this example:
QNetworkAccessManager *manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*))); manager->get(QNetworkRequest(QUrl("http://qt-project.org")));
Except perhaps replacing the get with post?
And also change the address and call one of the end point described here ?
Yes, I got it working this afternoon. It seems to work with get. I haven't handled any of the replies or error checks but I found another example and together with this it's working.
It all depends on the endpoint you are calling and how it's implemented on the other hand. The documentation tells which one you should use.