com.googlecode.autoandroid.positron
Class NanoHTTPD.Response

java.lang.Object
  extended by com.googlecode.autoandroid.positron.NanoHTTPD.Response
Enclosing class:
NanoHTTPD

public static class NanoHTTPD.Response
extends Object

HTTP response. Return one of these from serve().


Field Summary
 InputStream data
          Data of the response, may be null.
 Properties header
          Headers for the HTTP response.
 String mimeType
          MIME type of content, e.g.
 String status
          HTTP status code after processing, e.g.
 
Constructor Summary
NanoHTTPD.Response()
          Default constructor: response = HTTP_OK, data = mime = 'null'
NanoHTTPD.Response(String content)
           
NanoHTTPD.Response(String statusCode, String content)
           
NanoHTTPD.Response(String status, String mimeType, InputStream data)
          Basic constructor.
NanoHTTPD.Response(String status, String mimeType, String txt)
          Convenience method that makes an InputStream out of given text.
 
Method Summary
 void addHeader(String name, String value)
          Adds given line to the header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

status

public String status
HTTP status code after processing, e.g. "200 OK", HTTP_OK


mimeType

public String mimeType
MIME type of content, e.g. "text/html"


data

public InputStream data
Data of the response, may be null.


header

public Properties header
Headers for the HTTP response. Use addHeader() to add lines.

Constructor Detail

NanoHTTPD.Response

public NanoHTTPD.Response()
Default constructor: response = HTTP_OK, data = mime = 'null'


NanoHTTPD.Response

public NanoHTTPD.Response(String status,
                          String mimeType,
                          InputStream data)
Basic constructor.


NanoHTTPD.Response

public NanoHTTPD.Response(String status,
                          String mimeType,
                          String txt)
Convenience method that makes an InputStream out of given text.


NanoHTTPD.Response

public NanoHTTPD.Response(String statusCode,
                          String content)

NanoHTTPD.Response

public NanoHTTPD.Response(String content)
Method Detail

addHeader

public void addHeader(String name,
                      String value)
Adds given line to the header.