title: Parse Error while using Google Url Shortener Api in android
body: <p>I am trying to create POST request to Google Shortener Api in my android app. But it is returning Parse Error message with code 400. Here's my code...am I missing anything?</p>
  
  <pre><code>final String GOOGL_URL = "https://www.googleapis.com/urlshortener/v1/url";
  String tinyUrl = null;
  final Gson gson = new Gson();
  
  try
  {
      InputStream in;
      HttpClient client = new DefaultHttpClient();
      HttpResponse response;
      JSONObject json = new JSONObject();
      HttpPost post = new HttpPost(GOOGL_URL);
      json.put("key", "my_key");
      json.put("longUrl", longUrl);
      post.setHeader("json", json.toString());
      StringEntity se = new StringEntity(json.toString());
      se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,
                                            "application/json"));
      post.setEntity(se);
  
      response = client.execute(post);
      in = response.getEntity().getContent();
      BufferedReader br = new BufferedReader(new InputStreamReader(in));
      StringBuilder resultString = new StringBuilder();
      String lineGet;
  
      while ((lineGet = br.readLine()) != null) {
          resultString.append(lineGet);
      }
      if (Common.DEBUG) {
          Log.d(TAG, "Request string : " + json.toString());
          Log.d(TAG, "Response string : " + resultString);
      }
  
      GooGlResult result = gson.fromJson(resultString.toString(),
                                         GooGlResult.class);
  
      return result.getId();
  } 
  catch (Exception ex) {
      System.out.println("UrlShortener "+ex);
      return longUrl;
  }   
  </code></pre>
  
  <p>Thanks in advance..</p>