public final class RsWithHeader extends RsWrap
Remember, if a header is already present in the response, this
decorator will add another one, with the same name. It doesn't check
for duplicates. If you want to avoid duplicate headers, use this
decorator in combination with RsWithoutHeader
,
for example:
new RsWithHeader( new RsWithoutHeader(res, "Host"), "Host", "www.example.com" )
In this example, RsWithoutHeader
will remove the
Host
header first and RsWithHeader
will
add a new one.
The class is immutable and thread-safe.
Constructor and Description |
---|
RsWithHeader(Response res,
String header)
Ctor.
|
RsWithHeader(Response res,
String name,
String value)
Ctor.
|
RsWithHeader(String hdr)
Ctor.
|
RsWithHeader(String name,
String value)
Ctor.
|
public RsWithHeader(String hdr)
hdr
- Headerpublic RsWithHeader(String name, String value)
name
- Header namevalue
- Header valuepublic RsWithHeader(Response res, String name, String value)
res
- Original responsename
- Header namevalue
- Header valueCopyright © 2015 Takes. All rights reserved.