We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3477a04 commit 0a0ff3fCopy full SHA for 0a0ff3f
core/src/main/java/feign/Response.java
@@ -32,6 +32,7 @@
32
import static feign.Util.checkState;
33
import static feign.Util.decodeOrDefault;
34
import static feign.Util.valuesOrEmpty;
35
+import static feign.Util.toByteArray;
36
37
/**
38
* An immutable response to an http invocation which only returns string content.
@@ -277,6 +278,15 @@ public Reader asReader(Charset charset) throws IOException {
277
278
public void close() throws IOException {
279
inputStream.close();
280
}
281
+
282
+ @Override
283
+ public String toString() {
284
+ try {
285
+ return new String(toByteArray(inputStream), UTF_8);
286
+ } catch (Exception e) {
287
+ return super.toString();
288
+ }
289
290
291
292
private static final class ByteArrayBody implements Response.Body {
0 commit comments