我需要从Android
webView客户端发出x-www-form-urlencoded
post请求。我正在使用EncodingUtils
进行编码。这是我的代码:
String postdata = "sUrl=http%3A%2F%2Flocalhost%3A9000%2Fpayment%2Fpayu%2Fresponse&......."
.......
.......
webView.postUrl("https://test.payu.in/_payment", EncodingUtils.getBytes(POSTDATA, "BASE64"));
我正在使用BASE64
,但x-www-form-urlencided
应该有什么?我试着搜索,但什么都没有。做这件事的正确方法是什么?
它很简单,使用html表单并将其放在viewview中webView.loadDataWithBaseURL("file:///android_asset/index.html","text/html","UTF-8",null);