unity.scopes.qt.JsonReader

Class that downloads http JSON files synchronously. More...

#include <unity/scopes/qt/JsonReader.h>

Public Member Functions

QJsonDocumentSptr read (QUrl const &uri) const
 Downloads a remote JSON document and returns a parser containing the data. More...
 
QJsonDocumentSptr read (QString const &host, QJsonParameters const &parameters) const
 Downloads a remote JSON document and returns a parser containing the data. More...
 

Detailed Description

Class that downloads http JSON files synchronously.

Executes a remote HTTP query synchronously to return a JSON parser filled with the downloaded data.

Member Function Documentation

QJsonDocumentSptr unity::scopes::qt::JsonReader::read ( QUrl const &  uri) const

Downloads a remote JSON document and returns a parser containing the data.

Parameters
uriURI to download
Returns
shared pointer of a QJsonDocument containing the downloaded data.
QJsonDocumentSptr unity::scopes::qt::JsonReader::read ( QString const &  host,
QJsonParameters const &  parameters 
) const

Downloads a remote JSON document and returns a parser containing the data.

Parameters
hostthe remote host name
parametersThe parameters that will build the final query, defined by a list of pairs of key and value
Returns
shared pointer of a QJsonDocument containing the downloaded data.