File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
api/src/main/java/org/asynchttpclient Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ protected Charset calculateCharset(Charset charset) {
32
32
if (charset == null ) {
33
33
String contentType = getContentType ();
34
34
if (contentType != null )
35
- charset = parseCharset (contentType ); // parseCharset can return null
35
+ charset = parseCharset (contentType ); // parseCharset can return
36
+ // null
36
37
}
37
38
return charset != null ? charset : DEFAULT_CHARSET ;
38
39
}
@@ -128,11 +129,12 @@ public boolean hasResponseBody() {
128
129
@ Override
129
130
public String toString () {
130
131
try {
131
- return "ResponseBase{" +
132
- "statusCode=" + getStatusCode () +
133
- ", headers=" + getHeaders () +
134
- ", body='" + getResponseBody () + '\'' +
135
- '}' ;
132
+ return new StringBuilder ()//
133
+ .append (getClass ().getSimpleName ()).append (" {\n " )//
134
+ .append ("\t statusCode=" ).append (getStatusCode ()).append ("\n " )//
135
+ .append ("\t headers=" ).append (getHeaders ()).append ("\n " )//
136
+ .append ("\t body=\n " ).append (getResponseBody ()).append ("\n " )//
137
+ .append ("}" ).toString ();
136
138
} catch (IOException e ) {
137
139
throw new RuntimeException ("IOException occurred while trying to print response body" , e );
138
140
}
You can’t perform that action at this time.
0 commit comments