I’m trying to simply call a URL to handle a control of a cgi script on the web. The following function is what I’ve written, but it’s not making the call.
Here is the url that I call from Internet Explorer to achieve what I’m trying to do:
http://66.250.23.155:81/axis-cgi/com/ptz.cgi?zoom=8000
void VideoLayout::zoom(unsigned level)
{
QString strLevel = "zoom=";
strLevel += QString::number(level);
QByteArray ba(strLevel.toStdString().c_str());
QHttp camControl;
camControl.setHost("66.250.23.155", 81);
camControl.post("/axis-cgi/com/ptz.cgi", ba);
}
I sent this to Trolltech support and here was the response i got from them.
You usually cannot just do this kind of thing with a single HTTP post. Depending on the server you will probably get an HTTP response back, pointing you to the actual URL that you should post to.
I'm afraid there is no easy solution to this - you have to implement a complete HTTP response handler to actually do these kind of things.
I'm not sure what a response handler is? I tried to catch some feedback by calling some of the following routines, which return "unknown error"
QHttpResponseHeader response = camControl.lastResponse();
int statCode = response.statusCode();
QString err = response.reasonPhrase();
Any examples or help would be wonderful. Thanks.
Bookmarks