AsynckTask
在使用中发出请求NameValuePair
但没有得到响应
try
{
HttpConnectionParams.setConnectionTimeout(params,TIMEOUT_MILLISEC);
HttpConnectionParams.setSoTimeout(params,TIMEOUT_MILLISEC);
System.out.println(operation);
post = new HttpPost(operation);
if(nvp != null)
{
String temp = "dgdfg";
post.setEntity(new UrlEncodedFormEntity(nvp));
}
response = client.execute(post);
entity = response.getEntity();
if(entity != null)
{
result = EntityUtils.toString(entity);
}
else
{
Log.d("Response Failed","Response from server is failed");
}
}catch(Exception ex)
{
ex.printStackTrace();
}
网址
String url = "http://www.xxx.com/service/xxx.asmx/xxxxMethodName";
请求参数如
{
UserDetails = {
DeviceName = "My Phone";
DeviceToken = 707fc5a77124dd1a485608e8e03d31b708a0359b852df38bb3cc856e28;
EmailAddress = "admin@xxx.com";
IsRemember = True;
Password = "admin@xxx.com";
};
}
在 numvalues 中需要像
String mm = "{ UserDetails = {DeviceName=\"My Phone\"; DeviceToken = 707fc5a77124dd1a485608e8e03d31b708a0359b852df38bb3cc856e28;EmailAddress=\"admin@xxx.com\";IsRemember = True; Password = \"admin@xxx.com\"; };}";
但我没有到这里 [...]