我已经成功从我的网站获取数据,但无法发送信息并查看我发送的内容。 我在这里读了很多线索,他们都无法帮助我。这是我的JSON数据发送器函数。在Android Studio中发送和接收返回的JSON数据
protected void sendJson(final String email, final String pwd) {
Thread t = new Thread() {
public void run() {
Looper.prepare(); //For Preparing Message Pool for the child Thread
HttpClient client = new DefaultHttpClient();
// HttpConnectionParams.setConnectionTimeout(client.getParams(), 10000); //Timeout Limit
HttpResponse response;
JSONObject json = new JSONObject();
try {
HttpPost post = new HttpPost("https://www.google.com.br/mobile/test/");
json.put("name", email);
json.put("senha", pwd);
Log.d("TAG InfoDesejada", json.toString());
StringEntity se = new StringEntity(json.toString());
Log.d("TAG StringEnviada", se