gpt4 book ai didi

Android调用包含url中参数的XML Webservice

转载 作者:行者123 更新时间:2023-11-30 02:45:02 27 4
gpt4 key购买 nike

我正在尝试使用包含 web 服务参数的 get 方法调用 web 服务。但我无法在互联网上找到答案,请任何人帮助我。下面给出我的网络服务

http://api.crmseries.com/user/ValidateUser?email=don@crmSerssies.com&password=visi

最佳答案

这应该有效!

public void postData() {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://api.crmseries.com/user/ValidateUser");

try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("email", "don@crmSerssies.com"));
nameValuePairs.add(new BasicNameValuePair("password", "visi"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);

} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
} catch (IOException e) {
// TODO Auto-generated catch block
}
}

关于Android调用包含url中参数的XML Webservice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25199823/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com