This is what I did
connect(&http,SIGNAL(done(bool)),this,SLOT(httpDone(bool)));
http.setHost("www.google.com");
QString str
= "Email=somename@gmail.com&Passwd=somepassword" "&service=cl&source=Gulp-CalGulp-1.05";
header.setValue("Host", "https://www.google.com") ;
header.setContentType( "application/x-www-form-urlencoded" ) ;
http.
request(header,
QVariant(str
).
toByteArray());
connect(&http,SIGNAL(done(bool)),this,SLOT(httpDone(bool)));
connect(&http,SIGNAL(readyRead(const QHttpResponseHeader &)),this,SLOT(readyRead(const QHttpResponseHeader &)));
http.setHost("www.google.com");
QString str = "Email=somename@gmail.com&Passwd=somepassword"
"&service=cl&source=Gulp-CalGulp-1.05";
QHttpRequestHeader header( "POST", "/accounts/ClientLogin") ;
header.setValue("Host", "https://www.google.com") ;
header.setContentType( "application/x-www-form-urlencoded" ) ;
http.request(header,QVariant(str).toByteArray());
To copy to clipboard, switch view to plain text mode
{
//QString str = header.reasonPhrase();
result
= QString(http.
readAll().
data());
}
void UpdateChecker::readyRead(const QHttpResponseHeader &header)
{
//QString str = header.reasonPhrase();
result = QString(http.readAll().data());
}
To copy to clipboard, switch view to plain text mode
I got result as
<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://https/accounts/ClientLogin">here</A>.
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://https/accounts/ClientLogin">here</A>.
</BODY>
</HTML>
To copy to clipboard, switch view to plain text mode
Probably Qt itself is generating this.
Can you please give me some minimal example on how I encrypt the data and send ?
Thanks a lot.
Bookmarks