try
{
url= new URL(ConstantsClass.VENDOR_FOLLOW + "?UID=" +android_id+"&URL='"+resultfinal+"'&device=android");
connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");
request = new OutputStreamWriter(connection.getOutputStream());
request.flush();
request.close();
request.write("Hello!!!");
String line = "";
InputStreamReader isr = new InputStreamReader(connection.getInputStream());
BufferedReader reader = new BufferedReader(isr);
StringBuffer sb = new StringBuffer();
while((line=reader.readLine())!=null) {
sb.append(line + "&");
}
response = sb.toString();
//response.getEntity().getContent();
Log.i("Test", "updated response: " + response);
}
catch (IOException e) {
e.printStackTrace();
}
Log.i("Test", "**************url list********************" + url);
tag_text.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent in=new Intent(context,LinkWebView.class);
in.putExtra("vendorUrl", resultfinal);
context.startActivity(in);
//postData();
}
});
}
tag_text.setTextSize(16);
return view;
}
嗨,我是 android 新手,我正在尝试将值从 url 传递到服务器,但我在服务器端传递了空值。更新响应为空。我的服务器端值没有给我任何值。我需要从上面给出的 url 传递 url、android_id 和设备。我也尝试了httpclient,但它也给了我空值。