dimkanovikov / webloader Goto Github PK
View Code? Open in Web Editor NEWHigh level wrapper around QNetworkAccessManager for make network communications easy
License: GNU Lesser General Public License v3.0
High level wrapper around QNetworkAccessManager for make network communications easy
License: GNU Lesser General Public License v3.0
Суть таймера прерывающего выполнение по таймауту такова - если в течении заданного таймаута не было получено данных, то загрузку нужно прервать.
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);
}
Hello,
I have some local log files, which would need send to server side, how should I do this via WebLoader?
Thanks a lot!
Best regards, Jason
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;
^
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&)>)'
});
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!
Is it possible to use Basic access authentication (https://en.wikipedia.org/wiki/Basic_access_authentication) with this library?
Sometimes just would like to get the network status (connected, disconnected, connecting, etc) for the PC client, if there is some simple api or event for them, would be great. :-)
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
Opening the following url in a web browser shows a small PNG file as expected:
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):
Could you please help to understand what is going wrong?
Thank you very much.
Hi,
WebLoader is really good, and now I met an issue that how could I use WebLoader to download image file or zip file? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.