Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9243147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:44:43+00:00 2026-06-18T08:44:43+00:00

I am developing an app on BB 10 based on C++ where I need

  • 0

I am developing an app on BB 10 based on C++ where I need to send HTTP post requests to the server and retrieve some JSON data. Are there some framework classes that help you send HTTP post requests to the server? Any links to code etc.? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:44:44+00:00Added an answer on June 18, 2026 at 8:44 am

    I can’t remember which sample app I found this code in, but this worked for what I needed in my app.

    Add the following in c++

    header file (.hpp)

    public:
        Q_INVOKABLE void doNetworkRequest(QString url);
    
    signals:
    void networkReply(const QVariantMap &data);
    void networkError();
    
    private Q_SLOTS:
        void handleNetworkData(QNetworkReply *reply);
    
    private:
        QNetworkAccessManager networkManager;
    

    Then in add this in your main file (.cpp)

    this goes inside the main app function

    // Hook this signal so we can respond to network replies
    connect(&networkManager, SIGNAL(finished(QNetworkReply *)), this,
            SLOT(handleNetworkData(QNetworkReply *)));
    

    add these functions:

    void Top12Wines::doNetworkRequest(QString url)
    {
    qDebug() << "Request URL " << url;
    QUrl qurl = url;
    networkManager.get(QNetworkRequest(qurl));
    }
    
    void Top12Wines::handleNetworkData(QNetworkReply *reply)
    {
    
    if (!reply->error()) {
        qDebug() << "Got network data";
        // Let's get ALL the data
        const QByteArray response(reply->readAll());
    
        JsonDataAccess jda;
        QVariantMap results = jda.loadFromBuffer(response).toMap();
    
        emit networkReply(results);
    
    } else {
        qDebug() << "Got network error";
        emit networkError();
    }
    
    // Cleanup
    reply->deleteLater();
    }
    

    Then in your QML you can access it like so:

        _App.networkReply.connect(checkVersion); //
        _App.networkError.connect(checkVersionError);
        _App.doNetworkRequest("http://myserver/version.json");
    
    function checkVersion(data)
    {
        _App.networkReply.disconnect(checkVersion); //disconnect links after retrieving data
        _App.networkError.disconnect(checkVersionError);
        var newVersion = data.version;
    }
    
    function checkVersionError()
    {
        _App.networkReply.disconnect(checkVersion); //disconnect links after retrieving data
        _App.networkError.disconnect(checkVersionError);        
        //do something to alert user that an error occurred.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing the backend server for a turn based game using App Harbor and
I am developing a LAN-based database application. It involves a central server app to
I'm developing a simple iOS app where there is a table view with some
I'm developing an app based on the BluetoothChat sample code. I need to be
I am developing an app where i need to set spinner values dynamically based
I am developing one app which is based on the webservice and fetch the
I am developing an quiz based app and i wanted to know how i
I am developing a quiz based app. The quiz contains 1 question and 4
I have a winforms (VB 2008) based app that I'm developing and I want
I'm developing an intranet-based web app that integrates with Facebook via the Graph API.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.