[Qt-interest] Not able to send a file.
Mohammed Imran B
imran.ar20487 at gmail.com
Fri Mar 12 05:45:54 CET 2010
void Login::doLogin()
{
UName = lineEdit_UserName->text();
Password = lineEdit_Password->text();
QUrl tmpUrl;
request.setUrl(QUrl(some_url);
request.setHeader(QNetworkRequest::ContentTypeHeader,
"application/x-www-form-urlencoded");
tmpUrl.addQueryItem("username", UName);
tmpUrl.addQueryItem("password", Password);
manager->post(request, tmpUrl.encodedQuery());
}
And the slot:
void Login::replyFinished(QNetworkReply *reply)
{
if (reply->error())
{
QMessageBox::critical(this, "Error",
" sending error\n Could not connect to the
server.\n"+reply->errorString(),QMessageBox::Cancel);
return;
}
else
{
.....
}
}
reply->errorString() // Here it gives an error HTTP request failed.
On Thu, Mar 11, 2010 at 7:11 PM, Ramesh <ramesh.bs at robosoftin.com> wrote:
> You post ur source were u r facing problem.. we can track out here..
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Markus Goetz
> Sent: Thursday, March 11, 2010 7:06 PM
> To: ext Mohammed Imran B
> Cc: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] Not able to send a file.
>
> ext Mohammed Imran B wrote:
> > Hi,
> > I am not able to make request using QNetworkAccessmanager's POST
> > method in the Phone.
> > Its giving an error: HTTP request failed.
> >
> > The same application works fine as Desktop application.
> >
> > Any suggestions will be appreciated.
> >
> > Thanks and regards,
> > Imran.
> >
> Are you sure? I only find this error message in the QHttp sources, not
> in the QNetworkAccessManager code. We don't support QHttp anymore.
>
> Can you send in a very very minimal sample program that reproduces this
> error?
>
> Which Qt version are you using?
>
> Markus
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> -----------------------------------------------
> Robosoft Technologies - Come home to Technology
>
> Disclaimer: This email may contain confidential material. If you were not
> an intended recipient, please notify the sender and delete all copies.
> Emails to and from our network may be logged and monitored. This email and
> its attachments are scanned for virus by our scanners and are believed to be
> safe. However, no warranty is given that this email is free of malicious
> content or virus.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100312/b7839961/attachment.html
More information about the Qt-interest-old
mailing list