[Interest] Is there a QML way for doing web requests? Just for data, not for rendering.

Shawn Rutledge Shawn.Rutledge at qt.io
Thu Dec 28 14:25:15 CET 2017


On 22 Dec 2017, at 23:19, Mark Gaiser <markg85 at gmail.com> wrote:
> 
> Hi,
> 
> You know those fancy REST api's out there.
> How does one use them in QML?
> 
> For websockets the answer is simple: QML WebSocket.
> But i didn't find a way to just do a web request to some url and get it's data, at least not a way that seems "QMLified".
> 
> Sure, javascript can be used with it's XMLHttpRequest which will work just fine, but using it seems so.. not QML like. So is there a QML way to do such things?

Not AFAIK, except for anything (like Image) which has a source URL.

Why don’t you like XMLHttpRequest?  How would you want the QML API to look then? Do you expect to do some data processing in JS after you fetch the data, or just looking for a way to pass the data to some C++ code?  If the latter, why not do the loading in C++ too?

(at least some of those are rhetorical questions… ;-)



More information about the Interest mailing list