title: Receiving HttpsURLConnection.getInputStream() response is incomplete?
body: <p>I am currently trying to get the list of Jobs from DBT cloud but the response from my java code in incomplete but postman is able to get the complete response.</p>
  <pre><code>public static JobsDTO performGETListJobs(int accountId) throws Exception {
      JobsDTO jobsDTO = new JobsDTO();
      
      String URI = DEFAULT_DBT_URL + &quot;/&quot; + accountId + &quot;/jobs&quot;;
      StringBuilder response = new StringBuilder();
      try {
          URL url = new URL(URI);
          HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
          connection.setRequestMethod(&quot;GET&quot;);
          connection.setRequestProperty(&quot;Authorization&quot;, DEFAULT_AUTH_TOKEN);
          connection.setRequestProperty(&quot;Content-Type&quot;, &quot;application/json&quot;);
          connection.setRequestProperty(&quot;Accept&quot;, &quot;application/json&quot;);
          connection.setDoOutput(true);
          try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), &quot;utf-8&quot;))) {
              String responseLine = null;
              while ((responseLine = br.readLine()) != null) {
                  response.append(responseLine.trim());
              }
              System.out.println(&quot;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;);
              System.out.println(response.toString());
              System.out.println(&quot;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&quot;);
          }
      } catch (IOException e) {
          e.printStackTrace();
      }
      String res = response.toString();
      System.out.println(&quot;response : &quot; + mapper.writerWithDefaultPrettyPrinter().writeValueAsString(res));
      jobsDTO = (JobsDTO) toObjectDTO(res, JobsDTO.class);
      System.out.println(jobsDTO.getStatus().getIsSuccess());
      System.out.println(jobsDTO.getData().size());
      System.out.println(&quot;Response ready to send&quot;);
      return jobsDTO;
  }
  </code></pre>
  <p>Response from the above code is  :</p>
  <blockquote>
  <p>{&quot;<strong>status</strong>&quot;:{&quot;code&quot;:200,&quot;is_success&quot;:true,&quot;user_message&quot;:&quot;Success!&quot;,&quot;developer_message&quot;:&quot;&quot;},&quot;<strong>data</strong>&quot;:[],&quot;<strong>extra</strong>&quot;:{&quot;filters&quot;:{&quot;limit&quot;:100,&quot;offset&quot;:0,&quot;account_id&quot;:102743},&quot;order_by&quot;:&quot;id&quot;,&quot;pagination&quot;:{&quot;count&quot;:0,&quot;total_count&quot;:0}}}</p>
  </blockquote>
  <p>Response in Postman is :</p>
  <blockquote>
  <p>{
  &quot;<strong>status</strong>&quot;: {
  &quot;code&quot;: 200,
  &quot;is_success&quot;: true,
  &quot;user_message&quot;: &quot;Success!&quot;,
  &quot;developer_message&quot;: &quot;&quot;
  },
  &quot;<strong>data</strong>&quot;: [
  {
  &quot;execution&quot;: {
  &quot;timeout_seconds&quot;: 300
  },
  &quot;generate_docs&quot;: false,
  &quot;run_generate_sources&quot;: false,
  &quot;id&quot;: 126169,
  &quot;account_id&quot;: 102745,
  &quot;project_id&quot;: 156324,
  &quot;environment_id&quot;: 120510,
  &quot;name&quot;: &quot;Manual Run&quot;,
  &quot;dbt_version&quot;: null,
  &quot;created_at&quot;: &quot;2022-09-09T09:32:45.997218+00:00&quot;,
  &quot;updated_at&quot;: &quot;2022-09-09T09:32:45.997238+00:00&quot;,
  &quot;execute_steps&quot;: [
  &quot;dbt run&quot;,
  &quot;dbt test&quot;
  ],
  &quot;state&quot;: 1,
  &quot;deactivated&quot;: false,
  &quot;run_failure_count&quot;: 0,
  &quot;deferring_job_definition_id&quot;: null,
  &quot;lifecycle_webhooks&quot;: false,
  &quot;lifecycle_webhooks_url&quot;: null,
  &quot;triggers&quot;: {
  &quot;github_webhook&quot;: false,
  &quot;git_provider_webhook&quot;: false,
  &quot;custom_branch_only&quot;: false,
  &quot;schedule&quot;: false
  },
  &quot;settings&quot;: {
  &quot;threads&quot;: 4,
  &quot;target_name&quot;: &quot;default&quot;
  },
  &quot;schedule&quot;: {
  &quot;cron&quot;: &quot;0 * * * *&quot;,
  &quot;date&quot;: {
  &quot;type&quot;: &quot;every_day&quot;
  },
  &quot;time&quot;: {
  &quot;type&quot;: &quot;every_hour&quot;,
  &quot;interval&quot;: 1
  }
  },
  &quot;is_deferrable&quot;: false,
  &quot;generate_sources&quot;: false,
  &quot;cron_humanized&quot;: &quot;Every hour&quot;,
  &quot;next_run&quot;: null,
  &quot;next_run_humanized&quot;: null
  }
  ],
  &quot;<strong>extra</strong>&quot;: {
  &quot;filters&quot;: {
  &quot;limit&quot;: 100,
  &quot;offset&quot;: 0,
  &quot;account_id&quot;: 102745
  },
  &quot;order_by&quot;: &quot;id&quot;,
  &quot;pagination&quot;: {
  &quot;count&quot;: 1,
  &quot;total_count&quot;: 1
  }
  }
  }</p>
  </blockquote>
  <p>Data part is having empty array or the inputstream is not able to get that value.</p>
  <p>Please help me with getting the full response using java.</p>