Android WebView 通过post形式访问(postUrl)


 

Java代码   收藏代码
  1. //需要访问的网址  
  2. String url = "http://www.cqjg.gov.cn/netcar/FindThree.aspx";  
  3. //post访问需要提交的参数  
  4. String postDate = "txtName=zzz&QueryTypeLst=1&CertificateTxt=dsds";  
  5. //由于webView.postUrl(url, postData)中 postData类型为byte[] ,  
  6. //通过EncodingUtils.getBytes(data, charset)方法进行转换  
  7. webView.postUrl(url, EncodingUtils.getBytes(postDate, "BASE64")); 

猜你喜欢

转载自blog.csdn.net/rongwenbin/article/details/51785559