Code example for Header

Methods: getName

0
     * In this case, getHeaderField(0)  returns the status line, but getHeaderFieldKey(0) returns null. 
     */ 
    public String getHeaderFieldKey(int num) throws IOException {
        if (num < responseHeaders.length) {
            Header header = responseHeaders[num];
            return header.getName();
        } else { 
            return null; 
        } 
    } 
 
 
    /** 
     * Returns the answer length (excluding headers. This is the content-length 
     * field length) 
     */ 
    public int getLength() throws IOException { 
        String len = getHeaderField("content-length");
        if (len == null) {
            len = getHeaderField("Content-Length");