header blacklist code example

Example: blacklist header

Blacklist Headers from Logging
As of REST Assured 4.2.0 it's possible to blacklist 
headers so that they are not shown in the request
or response log. Instead the header value will be 
replaced with [ BLACKLISTED ]. You can enable this per 
header basis using the LogConfig:

given().config(config().logConfig(logConfig().blacklistHeader("Accept"))). ..
The response log will the print:

Request method:   GET
Request URI:    http://localhost:8080/something
Proxy:          <none>
Request params: <none>
Query params:   <none>
Form params:    <none>
Path params:    <none>
Headers:        Accept=[ BLACKLISTED ]
Cookies:        <none>
Multiparts:     <none>
Body:           <none>

Tags:

Misc Example