80,351
社区成员
发帖
与我相关
我的任务
分享
JSONObject jsonObject = new JSONObject();
jsonObject.put("userCode", username);
jsonObject.put("pwd", userpwd);
jsonObject.put("orgCode", code);
jsonObject.put("clientType", type);
StringEntity se = null;
try {
se = new StringEntity(jsonObject.toString());
}
catch (UnsupportedEncodingException e)
{ // TODO Auto-generated catch block
e.printStackTrace();
}
byte[] result = null;
try {
result = EntityUtils.toByteArray(se);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
webView.postUrl(httpurl, result);
//需要访问的网址
String url = "http://www.cqjg.gov.cn/netcar/FindThree.aspx";
//post访问需要提交的参数
String postDate = "txtName=zzz&QueryTypeLst=1&CertificateTxt=dsds";
//由于webView.postUrl(url, postData)中 postData类型为byte[] ,
//通过EncodingUtils.getBytes(data, charset)方法进行转换
webView.postUrl(url, EncodingUtils.getBytes(postDate, "BASE64"));
//需要访问的网址
String url = "http://www.cqjg.gov.cn/netcar/FindThree.aspx";
//post访问需要提交的参数
String postDate = "txtName=zzz&QueryTypeLst=1&CertificateTxt=dsds";
//由于webView.postUrl(url, postData)中 postData类型为byte[] ,
//通过EncodingUtils.getBytes(data, charset)方法进行转换
webView.postUrl(url, EncodingUtils.getBytes(postDate, "BASE64"));