Can't use HttpURLConnection.getResponseCode to obtain response code >=400

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 1.3.0_05
    • Component/s: core-libs
    • None
    • generic
    • solaris_8

      HttpURLConnection.getResponseCode throws FileNotFoundException if the
      HTTP response code is >=400.

      When calling HttpURLConnection.getResponseCode to obtain the HTTP
      response code, this method apparently invokes
      HttpURLConnection.getInputStream. However, getInputStream will throw
      an FileNotFoundException if the HTTP response code is >=400 and the
      URL does not end with either ".html", ".htm", "/" or ".txt".

      This problem prohibits us from using HttpURLConnection to connect to
      non-HTML based URL.

            Assignee:
            Unassigned
            Reporter:
            Waikwan Hui
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: