예제 #1
0
 private static StringEntity jsonStringEntity(String json) {
   return new StringEntity(json, UTF_8.name());
 }
예제 #2
0
 public void setBody(final String body) {
   this.body = (body != null) ? body.getBytes(Charset.forName(UTF_8.name())) : null;
   isBinaryBody = false;
 }
예제 #3
0
 public ResponseDefinition(final int statusCode, final String bodyContent) {
   this.status = statusCode;
   this.body = (bodyContent == null) ? null : bodyContent.getBytes(Charset.forName(UTF_8.name()));
 }
예제 #4
0
 public String getBody() {
   return (!isBinaryBody && body != null) ? new String(body, Charset.forName(UTF_8.name())) : null;
 }