Class HttpFastStringResponse

java.lang.Object
net.targetr.wtm3.net.http.HttpResponse
net.targetr.wtm3.net.http.response.HttpFastStringResponse

public class HttpFastStringResponse extends HttpResponse
Same as StringResponse but skips ETags and cache validation and disables gzip.
Author:
Dr Michael Gardiner
  • Field Details

  • Constructor Details

    • HttpFastStringResponse

      public HttpFastStringResponse(String text)
      Creates a plain text response suitable for sending to a client with content type of text/plain without adding ETag or gzip.
      Parameters:
      text - The text to send to client.
  • Method Details

    • write

      public void write(HttpRequest request, OutputStream out) throws Exception
      Overridden write implementation to make it faster.
      Overrides:
      write in class HttpResponse
      Parameters:
      request - Request associated with response.
      out - The OutputStream to write the response.
      Throws:
      Exception - If an error occurs while writing the response.