Package com.ramforth.webserver.http.headers

Examples of com.ramforth.webserver.http.headers.StringHttpHeader


        IHttpResponse httpResponse;

        if (httpRequest.getVersion().isHTTP11()) {
            httpResponse = new HttpResponse(HttpVersion.HTTP_11);
            httpResponse.setConnectionType(ConnectionType.KEEP_ALIVE);
            httpResponse.getHeaders().addHeader(new StringHttpHeader("Keep-Alive", "timeout=5, max=100"));
        } else {
            httpResponse = new HttpResponse(HttpVersion.HTTP_10);
            httpResponse.setConnectionType(ConnectionType.CLOSE);
        }
View Full Code Here


        SimpleDateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy hh:mm:ss zzz", Locale.US);
        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
        Date date = new Date();

        httpResponse.setVersion(HttpVersion.HTTP_11);
        httpResponse.getHeaders().addHeader(new StringHttpHeader("Date", formatter.format(date)));
        httpResponse.getHeaders().addHeader(new StringHttpHeader("Connection", "close"));
    }
View Full Code Here

                break;
            case "content-disposition":
                header = new ContentDispositionHttpHeader(rawValue);
                break;
            default:
                header = new StringHttpHeader(name, rawValue);
                break;
        }

        return header;
    }
View Full Code Here

    }

    @Override
    public void redirect(String destination) {
        statusCode = HttpStatusCode.STATUS_302_FOUND;
        headers.addHeader(new StringHttpHeader("Location", destination));
    }
View Full Code Here

TOP

Related Classes of com.ramforth.webserver.http.headers.StringHttpHeader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.