private boolean handleContent(HttpContent httpContent) throws RestServiceException {
    boolean success = true;
    if (request != null && !requestContentFullyReceived) {
      long processingStartTime = System.currentTimeMillis();
      nettyMetrics.bytesReadRate.mark(httpContent.content().readableBytes());
      requestContentFullyReceived = httpContent instanceof LastHttpContent;
      logger.trace("Received content for request {} on channel {}", request.getUri(), ctx.channel());
      try {
        request.addContent(httpContent);
      } catch (IllegalStateException e) {
        success = false;
        nettyMetrics.contentAdditionError.inc();
        onRequestAborted(new RestServiceException(e, RestServiceErrorCode.InvalidRequestState));
      } finally {
        long chunkProcessingTime = System.currentTimeMillis() - processingStartTime;
        nettyMetrics.requestChunkProcessingTimeInMs.update(chunkProcessingTime);
        request.getMetricsTracker().nioMetricsTracker.addToRequestProcessingTime(chunkProcessingTime);
      }
      boolean isPutOrPost =
          request.getRestMethod().equals(RestMethod.POST) || request.getRestMethod().equals(RestMethod.PUT);
      boolean isMultipart = request.isMultipart() && requestContentFullyReceived;
      boolean hasContinueAndIsPutOrPost =
          nettyConfig.nettyEnableOneHundredContinue && RestUtils.isPutOrPostS3RequestAndExpectContinue(request);
      if (success && (!isPutOrPost || isMultipart || hasContinueAndIsPutOrPost)) {
        if (hasContinueAndIsPutOrPost) {
          request.setArg(EXPECT, "");
          removeInternalKeyFromRequest();
          responseChannel = new NettyResponseChannel(ctx, nettyMetrics, performanceConfig, nettyConfig);
          // FIXME: The request could be accepted as ctor arg to NettyResponseChannel to avoid null pointers
          responseChannel.setRequest(request);
        }
        requestHandler.handleRequest(request, responseChannel);
      }
    } else {
      success = false;
      resetState();
      logger.warn("Received content when it was not expected on channel {}", ctx.channel());
      nettyMetrics.noRequestError.inc();
      onRequestAborted(
          new RestServiceException("Received content without a request", RestServiceErrorCode.InvalidRequestState));
    }
    return success;
  }
Handles a {@link HttpContent}.
<p/>
Checks to see that a valid {@link RestRequest} is available so that the content can be pushed into the request.
<p/>
If the HTTP method for the request is something other than POST, delegates handling of {@link RestRequest} to the
{@link RestRequestHandler} when {@link LastHttpContent} is received.
@param httpContent the {@link HttpContent} that needs to be handled.
@return {@code true} if the handling succeeded without problems.
@throws RestServiceException if there is an error handling the current {@link HttpContent}.
ambry-rest/src/main/java/com/github/ambry/rest/NettyMessageProcessor.java