Coder Social home page Coder Social logo

qtrest's People

Contributors

buelowp avatar charliewolf avatar jpnurmi avatar kafeg avatar xaionaro avatar

Stargazers

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

Watchers

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

qtrest's Issues

Using getVariantMap in C++ models

Why getVariantMap method is private in AbstractJsonRestListModel and AbstractXmlRestListModel? I think this method should be declared as protected similarly to getVariantList. The reason is that it can be useful for additional methods in C++ model. For example, calling an additional action of rest api.

Using models with C++

Thanks for missing part in QT!
Can you provide some code snippets of how to use your lib in C++?
I have a little trouble using ready model (JsonRestListModel) from within C++:

I tried the following code:

    APIBase * api = new APIBase();

    api->setBaseUrl("http://192.168.2.200:8888");

    JsonRestListModel model;

    model.setApiInstance(api);

    model.requests()->setGet("/api/object");
    model.requests()->setGetDetails("/api/object/{id}");

    QVariantMap filters;
    filters["isArchive"] = "0";
    model.setFilters(filters);

    QStringList fields;
    fields << "id" << "name" << "type";
    model.setFields(fields);

    model.fetchDetail("object_id");

But it returns "No item with id object_id"

When inheriting from APIBase, the following code works:

    MyApi * client = new MyApi();

    client->setBaseUrl("http://192.168.2.200:8888");

    QNetworkReply *reply = client->getObjectDetails("object_id");

    QEventLoop loop;
    connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
    loop.exec();

    QVERIFY(!reply->error());

    QJsonParseError parseError;
    QJsonDocument document = QJsonDocument::fromJson(reply->readAll(), &parseError);

MyApi looks like the following:

QNetworkReply *MyApi::getObjectDetails(QString id)
{
    if (id.isEmpty()) {
        qDebug() << "ID is empty!";
        return 0;
    }

    QUrl url = QUrl(baseUrl()+"/api/object/"+id);

    QNetworkReply *reply = get(url);

    return reply;
}

Tanx!

Not able to build and run qtrest-example

Hi,

I am trying to build your qtrest-example, but failing misreably . can you please help so that understanding the structure of qtrest client will eased out.

Support for custom SSL configuration

This looks like a very promising library. I would like to use it for communicating with our company private Buildbot using its REST API. The problem is that our Buildbot instance is proxied behind Apache, which is configured to do client certificate authentication (all employees have their own client certificate).

So I would need a way to configure the QSslConfiguration that qtrest uses, so that in my application, I can let the user select his/her .p12 certificate bundle to be used for authentication.

How to use?

Hello!
Sorry for this silly question, but can this be used for a website that has different API methods?
If yes, can you please just guide me some steps? Because I'm a bit new to C++ (Blame me) and need to know just some basic information about this :)

Thanks!

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.