[Qt-interest] Request to URL including percent
KIMURA, Hidetaka
kimura at jig.jp
Wed Dec 17 10:26:10 CET 2008
Thanks, but it makes a request to /a:b.
QUrl::fromPercentEncoding also did not make a request to /a%3Ab...
On Wed, 17 Dec 2008 11:31:12 +0700
"Anthony Serdyukov" <uksus70 at gmail.com> wrote:
> Use QUrl::fromEncoded method. Not sure the method name is correct, see docs.
>
> 2008/12/17, KIMURA, Hidetaka <kimura at jig.jp>:
> > Hello,
> >
> > I am using the network component of Qt.
> > When I try to access a url that has a percent, it automatically encodes it
> > into %25 and sends it to the remote host.
> >
> > Here is the sample code:
> >
> > #include <QApplication>
> > #include <QDebug>
> > #include <QNetworkAccessManager>
> > #include <QNetworkRequest>
> > #include <QNetworkReply>
> >
> > int main(int argc, char** argv)
> > {
> > QCoreApplication app(argc, argv);
> > QNetworkAccessManager manager;
> > QNetworkRequest req(QUrl("http://example.com/a%3Ab", QUrl::StrictMode));
> > QNetworkReply* rep = manager.get(req);
> > app.connect(rep, SIGNAL(finished()), SLOT(quit()));
> >
> > int rv = app.exec();
> > qDebug() << "URL:" << rep->url();
> > return rv;
> > }
> >
> >
> > This program generates an HTTP request like this:
> > GET /a%253Ab HTTP1.1
> >
> > Can I avoid this behavior and get correct request /a%3Ab ?
> >
> > Thanks,
> >
> > -------
> > KIMURA, Hide - kimura at jig.jp
> >
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> >
>
>
> --
> Regards,
> Anthony
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
-------
木村秀敬 - kimura at jig.jp
株式会社 jig.jp
More information about the Qt-interest-old
mailing list