throw new IllegalStateException("Impossible body: " + body);
}
}
private F.Promise<play.libs.ws.WSResponse> executeString(String body) {
FluentCaseInsensitiveStringsMap headers = new FluentCaseInsensitiveStringsMap(this.headers);
// Detect and maybe add charset
String contentType = headers.getFirstValue(HttpHeaders.Names.CONTENT_TYPE);
if (contentType == null) {
contentType = "text/plain";
}
String charset = AsyncHttpProviderUtils.parseCharset(contentType);
if (charset == null) {
charset = "utf-8";
headers.replace(HttpHeaders.Names.CONTENT_TYPE, contentType + "; charset=utf-8");
}
byte[] bodyBytes;
try {
bodyBytes = body.getBytes(charset);