今天调试网络请求部分时,当getInputStream失败时直接抛出异常。解决方法时在getInputStream之前获取ResponseCode 

if( connection.getResponseCode() != HttpURLConnection.HTTP_OK) return null;

  

相关文章:

  • 2021-10-25
  • 2021-08-06
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
猜你喜欢
  • 2022-12-23
  • 2021-08-11
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
相关资源
相似解决方案