如何从Android WebView客户端发出发布请求?

时间:2016-01-06 12:43:28

标签: android webview android-webview url-encoding

我需要从#clonning repository with sample git clone git@github.com:mind-blowing/samples.git #change current folder to sample application root cd samples/spring-boot/rest-handler-for-plain-text #running application using maven spring-boot plugin mvn spring-boot:run webView客户端发出x-www-form-urlencoded发布请求。我使用Android进行编码。这是我的代码:

EncodingUtils

我正在使用String postdata = "sUrl=http%3A%2F%2Flocalhost%3A9000%2Fpayment%2Fpayu%2Fresponse&......." ....... ....... webView.postUrl("https://test.payu.in/_payment", EncodingUtils.getBytes(POSTDATA, "BASE64")); ,但BASE64应该是什么?我试图搜索,但没有任何东西。这样做的正确方法是什么?

1 个答案:

答案 0 :(得分:0)

简单,使用html表单并将其放在viewview中 webView.loadDataWithBaseURL(" file:///android_asset/index.html" ;,," text / html"," UTF-8",null);

相关问题