code: public String getHeaderField(int pIndex) {
          // TODO: getInputStream() first, to make sure we have header fields
          if (pIndex >= responseHeaders.length) {
              return null;
          }
          String field = responseHeaders[pIndex];
  
          // pIndex == 0, means the response code etc (i.e. "HTTP/1.1 200 OK").
          if ((pIndex == 0) || (field == null)) {
              return field;
          }
          int idx = field.indexOf(':');
  
          return ((idx > 0)
                  ? field.substring(idx).trim()
                  : "");  // TODO: ""  or null?
      }
docs: Returns the value for the {@code n}<sup>th</sup> header field.
  It returns {@code null} if there are fewer than
  {@code n} fields.
  <p/>
  This method can be used in conjunction with the
  {@code getHeaderFieldKey} method to iterate through all
  the headers in the message.
  
  @param pIndex an index.
  @return the value of the {@code n}<sup>th</sup> header field.
  @see java.net.URLConnection#getHeaderFieldKey(int)