Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4655826

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0_05
    • 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: