title: Not receiving any data from callback url. Where am I going wrong in Android?
body: <p>This is my URL post:         </p>
  
  <pre><code>    String urlParameters = "&amp;consumer_key="+AppSession.getPocketConsumerKey()+"&amp;client_secret="+AppSession.getPocketRedirectUri();
      String request = "https://getpocket.com/v3/oauth/request";
      URL url;
      try {
  
  
  
  
          url = new URL(request);
          HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();           
          connection.setDoOutput(true);
          connection.setDoInput(true);
          connection.setInstanceFollowRedirects(false); 
          connection.setRequestMethod("POST"); 
          connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); 
          connection.setRequestProperty("charset", "utf-8");
          connection.setRequestProperty("X-Accept","application/x-www-form-urlencoded");
          connection.setUseCaches (false);
  
          connection.connect();
          DataOutputStream wr = new DataOutputStream(connection.getOutputStream ());
          wr.writeBytes(urlParameters);
          Log.d("urlparmas",urlParameters);
          wr.flush();
          wr.close();
  
  
  
          InputStream is = connection.getInputStream();
          BufferedReader rd = new BufferedReader(new InputStreamReader(is));
          String line;
          StringBuffer response = new StringBuffer(); 
          while((line = rd.readLine()) != null) {
            response.append(line);
            response.append('\r');
          }
          rd.close();
          Log.d( "response",response.toString());
  
        } catch (Exception e) {
  
          e.printStackTrace();
  
  
        } 
  </code></pre>
  
  <p>My redirect Uri: MyApp://callback</p>
  
  <pre><code>&lt;activity android:name="com.app.account.Register" android:launchMode="singleTask"&gt;
                  &lt;intent-filter&gt;
  
       &lt;action android:name="android.intent.action.VIEW" /&gt;
       &lt;category android:name="android.intent.category.DEFAULT" /&gt;
       &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
       &lt;data android:scheme="MyApp" android:host="callback"/&gt;
  
  
                      &lt;/intent-filter&gt;
              &lt;/activity&gt;
  </code></pre>
  
  <p>So, I am just not getting any reply from the callback url. Wondering where I've gone wrong in the code. </p>
  
  <p>Edit: </p>
  
  <pre><code>InputStream is = connection.getInputStream();
              BufferedReader rd = new BufferedReader(new InputStreamReader(is));
              String line;
              StringBuffer response = new StringBuffer(); 
              while((line = rd.readLine()) != null) {
                response.append(line);
                response.append('\r');
              }
              rd.close();
              Log.d( "response",response.toString());
  </code></pre>
  
  <p>This produces the error. </p>