title: Modifying request body in Zuul pre filter not working
body: <p>In my app I am using <code>netflix zuul</code> to route a request from a microservice (gateway) to another. The requests are being routed fine but I also want to introduce some parameters in the request body before it is routed to the appropriate microservice. For this I am using Zuul pre filter like this.</p>
  
  <pre><code>public class SimpleFilter extends ZuulFilter {
  
      private static Logger log = LoggerFactory.getLogger(SimpleFilter.class);
  
      @Override
      public String filterType() {
          return "pre";
      }
  
      @Override
      public int filterOrder() {
          return 1;
      }
  
      @Override
      public boolean shouldFilter() {
          return true;
      }
  
      @Override
      public Object run() {
  
          try {
              RequestContext context = RequestContext.getCurrentContext();
  
              InputStream in = (InputStream) context.get("requestEntity");
              if (in == null) {
                  in = context.getRequest().getInputStream();
              }
  
              String body = StreamUtils.copyToString(in, Charset.forName("UTF-8"));
  
              // body = "request body modified via set('requestEntity'): "+ body;
              body = body.toUpperCase();
              context.set("requestEntity", new ByteArrayInputStream(body.getBytes("UTF-8")));
  
          } catch (IOException e) {
              log.error(e.getMessage(), e);
          }
  
          return null;
      }
  
  }
  </code></pre>
  
  <p>For now I am just trying to change the body to upper case but the microservice to which this request is routed doesn't receive the modified body (upper case). Instead it receives the original one. Am I doing something wrong. Any help would be appreciated. Thanks !!</p>