美文网首页Android开发Android开发经验谈Android开发
Android WebView 通过post形式访问(postU

Android WebView 通过post形式访问(postU

作者: 闫鹏飞写字的地方 | 来源:发表于2018-06-05 01:07 被阅读3次
Java代码
  1. //需要访问的网址
    String url = "http://www.cqjg.gov.cn/netcar/FindThree.aspx";

  2. //post访问需要提交的参数
    String postDate = "txtName=zzz&QueryTypeLst=1&CertificateTxt=dsds";

  3. //由于webView.postUrl(url, postData)postData类型为byte[]

  4. 通过EncodingUtils.getBytes(data, charset)方法进行转换
    webView.postUrl(url, EncodingUtils.getBytes(postDate, "BASE64"));

相关文章

网友评论

    本文标题:Android WebView 通过post形式访问(postU

    本文链接:https://www.haomeiwen.com/subject/srbusftx.html