Class HttpFastStringResponse
java.lang.Object
net.targetr.wtm3.net.http.HttpResponse
net.targetr.wtm3.net.http.response.HttpFastStringResponse
Plain text response without automatic ETags, gzip or byte-range handling.
- Author:
- Dr Michael Gardiner
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe Content-Length header string.static final StringThe Content-Type header string.Fields inherited from class net.targetr.wtm3.net.http.HttpResponse
bytesWritten, code, headerLength, headers, info, version, writeErrorHandler -
Constructor Summary
ConstructorsConstructorDescriptionHttpFastStringResponse(String text) Creates a plain text response suitable for sending to a client with content type of text/plain without adding ETag or gzip. -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(HttpRequest request, OutputStream out) Writes headers and text, omitting the body for HEAD requests.Methods inherited from class net.targetr.wtm3.net.http.HttpResponse
getBodyInputStream, getContentLength, parseResponse, toString
-
Field Details
-
HEADER_CONTENT_LENGTH
The Content-Length header string.- See Also:
-
HEADER_CONTENT_TYPE
The Content-Type header string.- See Also:
-
-
Constructor Details
-
HttpFastStringResponse
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
Writes headers and text, omitting the body for HEAD requests.- Overrides:
writein classHttpResponse- Parameters:
request- Request associated with response.out- The OutputStream to write the response.- Throws:
Exception- If an error occurs while writing the response.
-