Esempio n. 1
0
 @Override
 public TypedData getBody() {
   if (body == null) {
     body =
         new ByteBufBackedTypedData(
             content, DefaultMediaType.get(headers.get(HttpHeaders.Names.CONTENT_TYPE)));
   }
   return body;
 }
Esempio n. 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;
  }
Esempio n. 3
0
 @Override
 public boolean isChunkedTransfer() {
   return Iterables.any(
       headers.getAll(HttpHeaderNames.TRANSFER_ENCODING),
       HttpHeaderValues.CHUNKED::contentEqualsIgnoreCase);
 }
Esempio n. 4
0
 @Override
 public boolean isExpectsContinue() {
   return Iterables.any(
       headers.getAll(HttpHeaderNames.EXPECT), HttpHeaderValues.CONTINUE::contentEqualsIgnoreCase);
 }
Esempio n. 5
0
 @Override
 public MediaType getContentType() {
   return DefaultMediaType.get(headers.get(HttpHeaderNames.CONTENT_TYPE));
 }
Esempio n. 6
0
 public boolean isAjaxRequest() {
   return HttpHeaderConstants.XML_HTTP_REQUEST.equalsIgnoreCase(
       headers.get(HttpHeaderConstants.X_REQUESTED_WITH));
 }