在我的android应用程序中,我尝试将json对象发送到远程服务器,当我运行它时,我在httpclient.execute(httpPost)中收到错误 这是我的代码的一部分。
public static String GET(String url , JSONObject js){
try {
HttpPost httpPost = new HttpPost(url);
httpPost.addHeader("Authorization", "Basic **********");
httpPost.setEntity(new StringEntity(js.toString()));
HttpClient httpclient = new DefaultHttpClient();
httpclient.execute(httpPost);
} catch (Exception e) {
Log.i("Console", "Error");
}
请帮助。