public final class RsWithHeaders extends Object implements Response
The class is immutable and thread-safe.
Constructor and Description |
---|
RsWithHeaders(Response res,
Collection<String> hdrs)
Ctor.
|
RsWithHeaders(Response res,
String... hdrs)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
InputStream |
body()
HTTP response body.
|
Iterable<String> |
head()
HTTP response head.
|
RsWithHeaders |
with(String text)
With this header.
|
RsWithHeaders |
with(String name,
String value)
With this header.
|
public RsWithHeaders(Response res, String... hdrs)
res
- Original responsehdrs
- Headerspublic RsWithHeaders(Response res, Collection<String> hdrs)
res
- Original responsehdrs
- Headerspublic RsWithHeaders with(String text)
text
- Header textpublic RsWithHeaders with(String name, String value)
name
- The namevalue
- The valuepublic Iterable<String> head() throws IOException
Response
head
in interface Response
IOException
- If something goes wrongpublic InputStream body() throws IOException
Response
body
in interface Response
IOException
- If something goes wrongCopyright © 2015 Takes. All rights reserved.