|
@@ -1,4 +1,4 @@
|
|
-package com.redhat.training;
|
|
|
|
|
|
+package net.p0f.k8s.demo.apiclient;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.BufferedReader;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@@ -15,9 +15,20 @@ public class ResponseFilter implements ClientResponseFilter {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
|
|
public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
|
|
- LOG.info("Got invoked: HTTP/" + responseContext.getStatus());
|
|
|
|
- LOG.info("Response Headers: ");
|
|
|
|
- responseContext.getHeaders().forEach((k, v ) -> {
|
|
|
|
|
|
+ LOG.info("Original request: " + requestContext.getMethod() + " " + requestContext.getUri());
|
|
|
|
+ LOG.info("Request Headers:");
|
|
|
|
+ requestContext.getHeaders().forEach((k, v) -> {
|
|
|
|
+ LOG.info(k + ": " + v);
|
|
|
|
+ });
|
|
|
|
+ if (requestContext.getEntity() != null) {
|
|
|
|
+ LOG.info("Request payload:");
|
|
|
|
+ LOG.info(requestContext.getEntity().toString());
|
|
|
|
+ } else {
|
|
|
|
+ LOG.info("Request payload empty.");
|
|
|
|
+ }
|
|
|
|
+ LOG.info("Got response: HTTP/" + responseContext.getStatus());
|
|
|
|
+ LOG.info("Response Headers:");
|
|
|
|
+ responseContext.getHeaders().forEach((k, v) -> {
|
|
LOG.info(k + ": " + v);
|
|
LOG.info(k + ": " + v);
|
|
});
|
|
});
|
|
LOG.info("Response Body:");
|
|
LOG.info("Response Body:");
|