Search code examples
blackberryqml

Namvaluepair blackberry 10


         //android List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
         nameValuePairs.add(new BasicNameValuePair("banker_username", value));
         nameValuePairs.add(new BasicNameValuePair("banker_password", value2));
          //blackberry 
         QByteArray postData;
        postData.append("banker_username="+user);
        postData.append("banker_password="+pass);
        QNetworkReply* reply = netManager->post(request,postData);

it doesnt work in bb like in android, how can i send params via post?


Solution

  • This is an example I used for Imgur upload. The rest of the code is here.

    multiPart->append(imagePart);
    QUrl url("https://api.imgur.com/3/upload");
    QNetworkRequest req(url);
    req.setRawHeader("Authorization",  "Client-ID yourimgurid");
    QNetworkReply* ipReply = netManager->post(req, multiPart);
    

    Basically you append to QNetworkRequest