Fenix Voltres
24th June 2009, 18:50
Hello,
I have a web page with (only) script which uses POST data. I want to write a program which would simply visit that page (without showing it / downloading / whatever) after clicking a button - so I wrote a function, which is called while clicking button:
QByteArray content("?id=1&etc=SomePostData");
QHttpRequestHeader header("POST", "/file.php");
header.setValue("Host", "www.hostname.com");
header.setContentType("application/x-www-form-urlencoded");
header.setContentLength(content.length());
QHttp *http = new QHttp("www.hostname.com", 80);
http->request(header, content);
and it actually does nothing :/
Would you tell me, what I've done wrong?
If i try to save that page into a file with request(header, content, &file) I got some error - program shuts down with window like uncatched exception one...
Thainks in an advance,
Fenix Voltres
I have a web page with (only) script which uses POST data. I want to write a program which would simply visit that page (without showing it / downloading / whatever) after clicking a button - so I wrote a function, which is called while clicking button:
QByteArray content("?id=1&etc=SomePostData");
QHttpRequestHeader header("POST", "/file.php");
header.setValue("Host", "www.hostname.com");
header.setContentType("application/x-www-form-urlencoded");
header.setContentLength(content.length());
QHttp *http = new QHttp("www.hostname.com", 80);
http->request(header, content);
and it actually does nothing :/
Would you tell me, what I've done wrong?
If i try to save that page into a file with request(header, content, &file) I got some error - program shuts down with window like uncatched exception one...
Thainks in an advance,
Fenix Voltres