[Qt-interest] Help Required to Perform HTTP Put using QNetworkAccessManger

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Wed Dec 1 07:31:29 CET 2010


>     QNetworkRequest request(QUrl("my url"));
>
>     QByteArray data;
>     QUrl param;
>
> param.addEncodedQueryItem("user_credentials",singleaccesstoken.toAscii());
>     param.addEncodedQueryItem("login","username");
>     param.addEncodedQueryItem("password","pwd");
>
>
>     data.append(param.toString().toAscii());
>     data.remove(0,1);

Why are you doing this?

If you want to encode your params, you can simply do
QUrl::toPercentEncoding(). This returns the encoded params in a
QByteArray.

>
>     nam->put(request,data);

Does the server support an HTT PUT request? Have you tried with
GET/POST instead?

HTH,
-mandeep

>
>
>
>
> whrere nam is a QNetworkAccessManger, in the reply of the this request i
> should get a success ful xml but instead i get a vague html login page.
>
>
> Can any body help me regarding this.
>
>
>
>
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>



More information about the Qt-interest-old mailing list