我正在尝试使用我尝试过此代码在我的 android 应用程序中发送一些信息
try{
JSONObject j = new JSONObject();
j.put("engineer", "me");
httppost.setEntity(new UrlEncodedFormEntity(j));
HttpResponse response = httpclient.execute(httppost);
/*Checking response*/
if(response!=null)
{
responseBody = EntityUtils.toString(response.getEntity());
}
if(responseBody.equals("ok"))
{
//...do something
}
} catch(ClientProtocolException e) {
} catch (IOException e) {
// TODO Auto-generated catch block
} catch(Exception e){
e.printStackTrace();
}
但我认为有一些错误
httppost.setEntity(new UrlEncodedFormEntity(j));
你能帮我解决这个问题吗