我正在开发一个在webview中加载jsp页面的应用程序。它使用Post方法将参数发送到jsp oage。我正在创建一个参数&的字符串。传递到像这样的帖子方法
w1.postUrl(protocol +"://"+host_ip+":"+portnumber+"/"+FOLDER+"/folder/data.jsp", EncodingUtils.getBytes(params, "BASE64"));
params="?username="+uname+"&password="+password;
现在我有两个问题
答案 0 :(得分:1)
使用HttpPost对象设置参数:
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(blobUploadURL);
String param="param";
httpPost.setParameter("parameter, param);
try {
HttpResponse response = httpClient.execute(httpPost);
statusCode = response.getStatusLine().getStatusCode();
}