public interface OutcomeBuilder
OutcomeBuilder withHeader(String name, String value)
name
- The header name
value
- The header value
OutcomeBuilder as(String contentType)
contentType
- Outcome Content-Type
OutcomeBuilder asTextual(String contentType)
contentType
- Outcome Content-Type
OutcomeBuilder asTextual(String contentType, Charset charset)
contentType
- Outcome Content-Type
charset
- Charset
OutcomeBuilder asJson()
OutcomeBuilder asJson(Charset charset)
charset
- Charset
OutcomeBuilder asTextPlain()
OutcomeBuilder asTextPlain(Charset charset)
charset
- Charset
OutcomeBuilder asXml()
OutcomeBuilder asXml(Charset charset)
charset
- Charset
OutcomeBuilder asHtml()
OutcomeBuilder asHtml(Charset charset)
charset
- Charset
OutcomeBuilder withBody(byte[] body)
body
- Body bytes
OutcomeBuilder withBody(CharSequence body)
body
- Body as CharSequence
OutcomeBuilder withBody(CharSequence body, Charset charset)
body
- Body as CharSequence
charset
- Character encoding to use
OutcomeBuilder withBody(InputStream body)
Use a chunk size as configured in werval.http.chunksize
body
- Body InputStream
OutcomeBuilder withBody(InputStream body, int chunkSize)
Content-Length header will NOT be set and chunked Transfer-Encoding used.
body
- Body InputStream, closed once consumed
chunkSize
- Desired HTTP chunk size
OutcomeBuilder withBody(InputStream body, long length)
body
- Body InputStream, closed once consumed
length
- Body length
Outcome build()