@Override
  public void handleRequest(RestRequest request, RequestContext requestContext, Callback<RestResponse> callback)
  {
    //This code path cannot accept content types or accept types that contain
    //multipart/related. This is because these types of requests will usually have very large payloads and therefore
    //would degrade server performance since RestRequest reads everything into memory.
    if (!isMultipart(request, requestContext, callback))
    {
      _restRestLiServer.handleRequest(request, requestContext, callback);
    }
  }
@Test
  public void testStreamRequestMultiplexedRequestMultiPartAcceptType() throws Exception
  {
    //This test verifies that a StreamRequest sent to the RestLiServer throws an exception if the accept type contains
    //multipart/related.
    StreamRequest streamRequestMux = new StreamRequestBuilder(new URI("/mux"))
        .setHeader(RestConstants.HEADER_ACCEPT, RestConstants.HEADER_VALUE_MULTIPART_RELATED).build(EntityStreams.emptyStream());

    Callback<StreamResponse> callback = new Callback<StreamResponse>()
    {
      @Override
      public void onSuccess(StreamResponse restResponse)
      {
        fail();
      }

      @Override
      public void onError(Throwable e)
      {
        assertTrue(e instanceof StreamException);
        StreamException streamException = (StreamException)e;
        StreamResponse streamResponse = streamException.getResponse();

        assertEquals(streamResponse.getStatus(), 406);
        final FullEntityReader fullEntityReader = new FullEntityReader(new Callback<ByteString>()
        {
          @Override
          public void onError(Throwable e)
          {
            Assert.fail();
          }

          @Override
          public void onSuccess(ByteString result)
          {
            //We have the body so assert
            assertTrue(result.length() > 0);
            assertEquals(result.asString(Charset.defaultCharset()),
                         "This server cannot handle multiplexed requests that have an accept type of multipart/related");
          }
        });
        streamResponse.getEntityStream().setReader(fullEntityReader);
      }
    };

    _server.handleRequest(streamRequestMux, new RequestContext(), callback);
  }