Namvaluepair黑莓10

时间:2014-09-18 08:16:57

标签: blackberry qml

         //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);

它在bb中不起作用,如在android中,我如何通过post发送params?

1 个答案:

答案 0 :(得分:1)

这是我用于Imgur上传的示例。其余代码为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);

基本上你附加到QNetworkRequest