@@ -207,8 +207,10 @@ public byte[] getContentAsByteArray() {
207
207
}
208
208
209
209
/**
210
- * Get the content of the response body as a {@code String}, using the configured
211
- * {@linkplain #getCharacterEncoding character encoding}.
210
+ * Get the content of the response body as a {@code String}, using the charset
211
+ * specified for the response by the application, either through
212
+ * {@link HttpServletResponse} methods or through a charset parameter on the
213
+ * {@code Content-Type}.
212
214
* @return the content as a {@code String}
213
215
* @throws UnsupportedEncodingException if the character encoding is not supported
214
216
* @see #getContentAsString(Charset)
@@ -221,12 +223,15 @@ public String getContentAsString() throws UnsupportedEncodingException {
221
223
/**
222
224
* Get the content of the response body as a {@code String}, using the provided
223
225
* {@code fallbackCharset} if no charset has been explicitly defined and otherwise
224
- * using the configured {@linkplain #getCharacterEncoding character encoding}.
226
+ * using the charset specified for the response by the application, either
227
+ * through {@link HttpServletResponse} methods or through a charset parameter on the
228
+ * {@code Content-Type}.
225
229
* @return the content as a {@code String}
226
230
* @throws UnsupportedEncodingException if the character encoding is not supported
227
231
* @since 5.2
228
232
* @see #getContentAsString()
229
233
*/
234
+
230
235
public String getContentAsString (Charset fallbackCharset ) throws UnsupportedEncodingException {
231
236
return isCharset () ?
232
237
this .content .toString (this .characterEncoding ) :
0 commit comments