我必须将一些参数发送到网址并打开它,但我不知道该怎么做
var variables:URLVariables = new URLVariables();
variables.param1 = "param1";
variables.param2 = "param2";
var request:URLRequest = new URLRequest("https://www.paypal.com/cgi-bin/webscr");
request.method = URLRequestMethod.POST;
request.data = variables;
navigateToURL(request,"_blank");
这是IOS中的一个例子,但我不知道如何在android
中做到这一点我认为我必须以意图来做,但
params = URLEncoder.encode(""+ "cmd=param1"+ "&business=param2"+"utf-8");
String url = "https://www.paypal.com/cgi-bin/webscr" + params;
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
我想我应该这样做,但它不起作用 我发送给paypal
答案 0 :(得分:2)
这就是我要找的东西
String uri = Uri.parse("https://www.paypal.com/cgi-bin/webscr")
.buildUpon()
.appendQueryParameter("param1", "param1")
.appendQueryParameter("param2", "parma2")
.build().toString();
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(browserIntent);