//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?
答案 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