Groovy Documentation

betamax.proxy
[Groovy] Interface WritableResponse

betamax.proxy.Response
  betamax.proxy.Message
      betamax.proxy.WritableResponse
All Superinterfaces:
Response, Message

interface WritableResponse
extends Response

Method Summary
void addHeader(java.lang.String name, java.lang.String value)

Adds a header to this response.

java.io.OutputStream getOutputStream()

Returns a stream that can be used to write data to the response body.

java.io.Writer getWriter()

Returns a `Writer` that can be used to write text to the response body.

void setError(int status, java.lang.String reason)

void setStatus(int status)

 
Methods inherited from interface Response
getContentType, getStatus
 
Methods inherited from interface Message
getBodyAsBinary, getBodyAsText, getHeader, getHeaders, hasBody
 

Method Detail

addHeader

void addHeader(java.lang.String name, java.lang.String value)
Adds a header to this response. Multiple headers with the same name can be added.
Parameters:
name - the header name.
value - the header value.


getOutputStream

java.io.OutputStream getOutputStream()
Returns a stream that can be used to write data to the response body. If the response body should be encoded then this method must return an `OutputStream` implementation that will handle the encoding.
Returns:
a stream for writing data to the response body.


getWriter

java.io.Writer getWriter()
Returns a `Writer` that can be used to write text to the response body. If the response body should be encoded then this method must return a `Writer` implementation that will handle the encoding.
Returns:
a writer for writing text to the response body.


setError

void setError(int status, java.lang.String reason)


setStatus

void setStatus(int status)


 

Groovy Documentation