title: cURL to httppost Java in Android and debug output from request
body: <p>This is the script that works:</p>
  
  <pre><code>curl -H  'content-type:application/json' -d '{"userrequest": {"username": "testname", "status": 1}}'  http://http://employeestracking.appspot.com/clockin.add_clockin
  </code></pre>
  
  <p>This is what I tried to use in android:
  further,How can I see/debug the output?</p>
  
  <pre><code>                    HttpParams httpParams = new BasicHttpParams();
                  HttpClient client = new DefaultHttpClient(httpParams);
                  HttpPost httpost = new HttpPost("http://employeestracking.appspot.com/clockin.add_clockin");
                  httpost.setHeader("Accept", "application/json");
                  httpost.setHeader("Content-type", "application/json");
                  System.out.println("2");
                  JSONObject data = new JSONObject();
                  JSONObject userrequest = new JSONObject();
                  HttpResponse response = null;
                  try {
                      userrequest.put("username","TestDemo");
                      userrequest.put("status",1);
                      data.put("userrequest", userrequest);
                      System.out.println(data);
                      httpost.getParams().setParameter("data",data);
                      try {
                          response = client.execute(httpost);
                          System.out.println(response);
                      } catch (ClientProtocolException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                      } catch (IOException e) {
                          // TODO Auto-generated catch block
                          e.printStackTrace();
                      }
  
                  } catch (JSONException e) {
                      // TODO Auto-generated catch block
                      e.printStackTrace();
                  }
  </code></pre>
  
  <p>this is what i get from the server:</p>
  
  <pre><code>41.132.228.221 - - [26/Jan/2012:01:18:29 -0800] "POST /clockin.add_clockin HTTP/1.1" 400 663 - "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"
  </code></pre>
  
  <p>41.132.228.221 - - [26/Jan/2012:01:18:55 -0800] "POST /clockin.add_clockin HTTP/1.1" 200 151 - "curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15"
  0.1.0.1 - - [26/Jan/2012:01:31:52 -0800] "GET /tasks/train HTTP/1.1" 404 124 - "AppEngine-Google; (+http://code.google.com/appengine)"
  41.132.228.221 - - [26/Jan/2012:01:37:17 -0800] "POST /clockin.add_clockin HTTP/1.1" 500 663 - -</p>