A builder for populating io.reactivex.netty.protocol.http.server.HttpServerResponse objects, useful only in testing scenarios. DO NOT use production.
| Constructor and description |
|---|
HttpServerResponseBuilder
(io.reactivex.netty.protocol.http.server.HttpServerResponse httpMessage, java.nio.charset.Charset charset) |
| Type | Name and description |
|---|---|
HttpServerResponseBuilder |
contentType(java.lang.CharSequence contentType)Sets the content type for the request |
HttpServerResponseBuilder |
created()Sets a created status |
protected void |
defaultContentType(java.lang.String contentType) |
protected void |
defaultJsonContentType() |
HttpServerResponseBuilder |
forbidden()Sets an FORBIDDEN status |
HttpServerResponseBuilder |
header(java.lang.CharSequence name, java.lang.Object value)Sets a request header |
HttpServerResponseBuilder |
json(groovy.lang.Closure callable)Adds JSON to the body of the request |
HttpServerResponseBuilder |
json(java.util.List array)Adds JSON to the body of the request |
HttpServerResponseBuilder |
json(java.util.Map json)Adds JSON to the body of the request |
HttpServerResponseBuilder |
json(java.lang.String json)Adds JSON to the body of the request |
HttpServerResponseBuilder |
noContent()Sets a NO_CONTENT status |
HttpServerResponseBuilder |
notFound()Sets not found status |
HttpServerResponseBuilder |
ok()Sets an ok status |
HttpServerResponseBuilder |
status(int code)Sets the status of the response |
HttpServerResponseBuilder |
status(io.netty.handler.codec.http.HttpResponseStatus status)Sets the status of the response |
HttpServerResponseBuilder |
unauthorized()Sets an UNAUTHORIZED status |
HttpServerResponseBuilder |
unprocessable()Sets a UNPROCESSABLE_ENTITY status |
HttpServerResponseBuilder |
xml(java.lang.String xml)Sets the body of the request to the XML string argument. |
HttpServerResponseBuilder |
xml(groovy.lang.Closure closure)Sets the body of the request to the XML defined by the closure. |
HttpServerResponseBuilder |
xml(groovy.util.slurpersupport.GPathResult xml)Sets the body of the request to the XML GPathResult argument. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Sets the content type for the request
contentType - The content typeSets a created status
Sets an FORBIDDEN status
Sets a request header
name - The name of the headervalue - The value of the headerAdds JSON to the body of the request
callable - The callable that defines the JSONAdds JSON to the body of the request
array - The JSON arrayAdds JSON to the body of the request
json - The JSON as a mapAdds JSON to the body of the request
json - The JSON as a mapSets a NO_CONTENT status
Sets not found status
Sets an ok status
Sets the status of the response
code - The status codeSets the status of the response
code - The status codeSets an UNAUTHORIZED status
Sets a UNPROCESSABLE_ENTITY status
Sets the body of the request to the XML string argument.
xml - The XML to be used as the body of the requestSets the body of the request to the XML defined by the closure. Uses groovy.xml.StreamingMarkupBuilder to produce the XML
closure - The closure that defines the XMLSets the body of the request to the XML GPathResult argument.
xml - The XML to be used as the body of the request