|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jayway.restassured.filter.log.RequestLoggingFilter
public class RequestLoggingFilter
Will log the request before it's passed to HTTP Builder. Note that HTTP Builder and HTTP Client will add additional headers. This filter will only log things specified in the request specification. I.e. you can NOT regard the things logged here to be what's actually sent to the server. Also subsequent filters may alter the request after the logging has took place. If you need to log what's actually sent on the wire refer to the HTTP Client logging docs or use an external tool such as Wireshark.
| Constructor Summary | |
|---|---|
RequestLoggingFilter()
Logs to System.out |
|
RequestLoggingFilter(LogDetail logDetail)
Logs with a specific detail to System.out |
|
RequestLoggingFilter(LogDetail logDetail,
boolean shouldPrettyPrint,
PrintStream stream)
Instantiate a logger using a specific print stream and a specific log detail |
|
RequestLoggingFilter(LogDetail logDetail,
PrintStream stream)
Instantiate a logger using a specific print stream and a specific log detail. |
|
RequestLoggingFilter(PrintStream printStream)
Logs everyting to the specified printstream. |
|
| Method Summary | |
|---|---|
Response |
filter(FilterableRequestSpecification requestSpec,
FilterableResponseSpecification responseSpec,
FilterContext ctx)
Filter the incoming request and response specifications and outgoing response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequestLoggingFilter()
public RequestLoggingFilter(LogDetail logDetail)
logDetail - The log detailpublic RequestLoggingFilter(PrintStream printStream)
printStream - The stream to log to.
public RequestLoggingFilter(LogDetail logDetail,
PrintStream stream)
logDetail - The log detailstream - The stream to log to.
public RequestLoggingFilter(LogDetail logDetail,
boolean shouldPrettyPrint,
PrintStream stream)
logDetail - The log detailshouldPrettyPrint - true if pretty-printing of the body should occur.stream - The stream to log to.| Method Detail |
|---|
public Response filter(FilterableRequestSpecification requestSpec,
FilterableResponseSpecification responseSpec,
FilterContext ctx)
FilterFilterContext.next(com.jayway.restassured.specification.FilterableRequestSpecification, com.jayway.restassured.specification.FilterableResponseSpecification) when you're done otherwise the request will not be delivered.
It's of course possible to abort the filter chain execution by returning a Response directly.
filter in interface FilterrequestSpec - The incoming request specresponseSpec - The incoming response specctx - The filter context. You need to call FilterContext.next(com.jayway.restassured.specification.FilterableRequestSpecification, com.jayway.restassured.specification.FilterableResponseSpecification) when you're done otherwise the request will not be delivered.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||