我需要使用一些服务。 ,我需要调用的服务方法需要得到两个参数 1. INT 2.一些枚举如何在需要调用http post调用时发送参数?
我不知道如何发送这些参数和如何使这个电话。 我想使用此代码
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("param1", val1);
nameValuePairs.add(new BasicNameValuePair("param2", val2);
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse p = httpclient.execute(httppost);
但是这代码不能发送INT作为参数(仅字符串) 第二个参数(这是一些枚举),我认为我可以为字符串发送和服务另一方会将此字符串转换为枚举(对不对?)
伙计们...服务器端不在我的控制之下:) – Yanshof 2011-12-21 12:46:27