Coder Social home page Coder Social logo

webloader's People

Contributors

armijo38 avatar dimkanovikov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

webloader's Issues

Got "not captured" issue when using loadAsync api

Hello,

I am just trying below api to wrap a little, and want to LOG the input urlStr and jsonData in the callback, while got error when compiling, how to deal with such problem? Thanks again!


C:\util\global.cpp:133: error: 'urlStr' is not captured
LOG(TRACE) << "urlStr=" << urlStr << ", jsonData=" << jsonData << ", replyData=" << replyData;
^
C:\util\global.cpp:133: error: 'jsonData' is not captured
LOG(TRACE) << "urlStr=" << urlStr << ", jsonData=" << jsonData << ", replyData=" << replyData;
^


void Global::postJsonDataToCloud(const QString urlStr, const QString jsonData)
{
NetworkRequest *request = new NetworkRequest();
request->setRequestMethod(NetworkRequest::Post);
request->setRawRequest(jsonData.toUtf8(), "application/json");
connect(request, &NetworkRequest::downloadComplete, [] (const QByteArray& replyData) {
LOG(TRACE) << "urlStr=" << urlStr << ", jsonData=" << jsonData << ", replyData=" << replyData;
});
request->loadAsync(urlStr);
}

Got error when build regarding TooManyRedirectsError and InsecureRedirectError..

Hello,

I used Qt 5.5.1, and import the project, when compiling, got below error. How could I fix this? Thanks!

D:\gitrepository\WebLoader-master\src\WebLoader_p.cpp:75: error: 'TooManyRedirectsError' is not a member of 'QNetworkReply'
case QNetworkReply::TooManyRedirectsError: result = "while following redirects, the maximum limit was reached. The limit is by default set to 50 or as set by QNetworkRequest::setMaxRedirectsAllowed()."; break;
^

D:\gitrepository\WebLoader-master\src\WebLoader_p.cpp:76: error: 'InsecureRedirectError' is not a member of 'QNetworkReply'
case QNetworkReply::InsecureRedirectError: result = "while following redirects, the network access API detected a redirect from a encrypted protocol (https) to an unencrypted one (http)."; break;
^

no matching function for call to 'NetworkRequest::loadAsync

Hello,
I am trying to write below code:

        NetworkRequest request;
        request.setRequestMethod(NetworkRequest::Post);
        request.setRawRequest(postJsonData.toUtf8(), "application/json");
        request.loadAsync("http://www.webforgood.com/api/v2/updatecloudconfig", [] (const QByteArray& replyData) {
            LOG(TRACE) << "replyData=" << replyData;
        });

But got this error, anything I did wrong? Or just not supported? Thanks!
D:\gitrepository\ui-desktop\mainwindow.cpp:572: error: no matching function for call to 'NetworkRequest::loadAsync(const char [47], MainWindow::nativeEvent(const QByteArray&, void*, long int*)::<lambda(const QByteArray&)>)'
});

How to set or handle timeout related things?

Hi,

Just found this neat and lightweight lib for qt, and just would like to know how to set or handle timeout related things?

For example, regarding below code, if github.com is down, how long it will wait and how about the result of data?
const QByteArray data = NetworkRequestLoader::loadSync("https://github.com");

Thanks!

Problem to compile with QtCreator

WebloaderErrors.log

I try to compile with Qt Creator (Qt 5.9.9) and gave me several errors (attached in WebloaderErrors.log). Some of these errors are the similar but I couldn't find the way to solve this.

Thanks in advance.
Hernan

Possible issue with redirection? (HTTP 302)

Opening the following url in a web browser shows a small PNG file as expected:

https://fahrinfo.bvg.de/tiles/base/16/35202/44041.png

Trying to download the png with the following code will fail.

QPixmap pixmap;
auto b = NetworkRequestLoader::loadSync("https://fahrinfo.bvg.de/tiles/base/16/35202/44041.png");
pixmap.loadFromData(b);
qDebug() << pixmap.save("D:/Tile.png");

(I tried also the more up-to-date code inside KITScenarist/src/libs/webloader/ with no luck)

The library is redirected instead to an error page (HTTP 404):

https://www.bvg.de/de/System/Ooops-Verfahren

Could you please help to understand what is going wrong?
Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.