/** Creates a new HttpResponseImpl with user provided parameters * @param code the HTTP Response code, see <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a> * for these codes * @param responseString the response string to be sent back * @param contentType the content type to be sent back */ protected HttpResponseImpl(int code, String responseString, String contentType){ this.responseString = responseString; this.code = code; // Default headers setHeader("Server", getServerName()); setHeader("Connection","close"); setHeader("Content-Type",contentType); // create the body. initBody(); }
/** * Creates a new HttpResponseImpl with user provided parameters * * @param code the HTTP Response code, see <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a> * for these codes * @param responseString the response string to be sent back * @param contentType the content type to be sent back */ protected HttpResponseImpl(final int code, final String responseString, final String contentType) { this.responseString = responseString; this.code = code; // Default headers setHeader("Server", getServerName()); setHeader("Connection", "close"); setHeader("Content-Type", contentType); // create the body. initBody(); }
/** * Creates a new HttpResponseImpl with user provided parameters * * @param code the HTTP Response code, see <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a> * for these codes * @param responseString the response string to be sent back * @param contentType the content type to be sent back */ protected HttpResponseImpl(final int code, final String responseString, final String contentType) { this.responseString = responseString; this.code = code; // Default headers setHeader("Server", getServerName()); setHeader("Connection", "close"); setHeader("Content-Type", contentType); // create the body. initBody(); }