Beispiel #1
0
 @Override
 public TypedData getBody() {
   if (body == null) {
     body =
         new ByteBufBackedTypedData(
             content, DefaultMediaType.get(headers.get(HttpHeaders.Names.CONTENT_TYPE)));
   }
   return body;
 }
Beispiel #2
0
  public Set<Cookie> getCookies() {
    if (cookies == null) {
      String header = headers.get(HttpHeaderNames.COOKIE);
      if (header == null || header.length() == 0) {
        cookies = Collections.emptySet();
      } else {
        cookies = ServerCookieDecoder.STRICT.decode(header);
      }
    }

    return cookies;
  }
Beispiel #3
0
 @Override
 public boolean isChunkedTransfer() {
   return Iterables.any(
       headers.getAll(HttpHeaderNames.TRANSFER_ENCODING),
       HttpHeaderValues.CHUNKED::contentEqualsIgnoreCase);
 }
Beispiel #4
0
 @Override
 public boolean isExpectsContinue() {
   return Iterables.any(
       headers.getAll(HttpHeaderNames.EXPECT), HttpHeaderValues.CONTINUE::contentEqualsIgnoreCase);
 }
Beispiel #5
0
 @Override
 public MediaType getContentType() {
   return DefaultMediaType.get(headers.get(HttpHeaderNames.CONTENT_TYPE));
 }
Beispiel #6
0
 public boolean isAjaxRequest() {
   return HttpHeaderConstants.XML_HTTP_REQUEST.equalsIgnoreCase(
       headers.get(HttpHeaderConstants.X_REQUESTED_WITH));
 }