Package contrib
Class NanoHTTPD.Response
- java.lang.Object
-
- contrib.NanoHTTPD.Response
-
- Enclosing class:
- NanoHTTPD
public class NanoHTTPD.Response extends java.lang.Object
HTTP response. Return one of these from serve().
-
-
Field Summary
Fields Modifier and Type Field Description java.io.InputStream
data
Data of the response, may be null.java.util.Properties
header
Headers for the HTTP response.java.lang.String
mimeType
MIME type of content, e.g.long
size
Size of the response.java.lang.String
status
HTTP status code after processing, e.g.
-
Constructor Summary
Constructors Constructor Description Response()
Default constructor: response = HTTP_OK, data = mime = 'null'Response(java.lang.String status, java.lang.String mimeType, java.io.InputStream data)
Basic constructor.Response(java.lang.String status, java.lang.String mimeType, java.lang.String txt)
Convenience method that makes an InputStream out of given text.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeader(java.lang.String name, java.lang.String value)
Adds given line to the header.
-
-
-
Field Detail
-
status
public java.lang.String status
HTTP status code after processing, e.g. "200 OK", HTTP_OK
-
mimeType
public java.lang.String mimeType
MIME type of content, e.g. "text/html"
-
data
public java.io.InputStream data
Data of the response, may be null.
-
header
public java.util.Properties header
Headers for the HTTP response. Use addHeader() to add lines.
-
size
public long size
Size of the response.
-
-
Constructor Detail
-
Response
public Response()
Default constructor: response = HTTP_OK, data = mime = 'null'
-
Response
public Response(java.lang.String status, java.lang.String mimeType, java.io.InputStream data)
Basic constructor.
-
Response
public Response(java.lang.String status, java.lang.String mimeType, java.lang.String txt)
Convenience method that makes an InputStream out of given text.
-
-