Polishing
This commit is contained in:
@@ -155,7 +155,7 @@ public class ExchangeResult {
|
||||
|
||||
|
||||
/**
|
||||
* Return the status of the executed request.
|
||||
* Return the HTTP status code as an {@link HttpStatus} enum value.
|
||||
*/
|
||||
public HttpStatus getStatus() {
|
||||
return this.response.getStatusCode();
|
||||
@@ -219,16 +219,12 @@ public class ExchangeResult {
|
||||
"\n" +
|
||||
formatBody(getRequestHeaders().getContentType(), this.requestBody) + "\n" +
|
||||
"\n" +
|
||||
"< " + getStatus() + " " + getStatusReason() + "\n" +
|
||||
"< " + getStatus() + " " + getStatus().getReasonPhrase() + "\n" +
|
||||
"< " + formatHeaders(getResponseHeaders(), "\n< ") + "\n" +
|
||||
"\n" +
|
||||
formatBody(getResponseHeaders().getContentType(), this.responseBody) +"\n";
|
||||
}
|
||||
|
||||
private String getStatusReason() {
|
||||
return getStatus().getReasonPhrase();
|
||||
}
|
||||
|
||||
private String formatHeaders(HttpHeaders headers, String delimiter) {
|
||||
return headers.entrySet().stream()
|
||||
.map(entry -> entry.getKey() + ": " + entry.getValue())
|
||||
|
||||
Reference in New Issue
Block a user