title: Spring cloud gateway: How to create a filter
body: <p>I'm new to spring cloud gateway.</p>
  
  <p>I've been watching some of the youtube videos from the SpringDeveloper channel and am working on the following example:</p>
  
  <pre><code>@Bean
  public RouteLocator myRoutes(RouteLocatorBuilder builder) {
  
      return builder.routes()
              .route(r -&gt; r.path("/get")
              .addRequestHeader("X-SpringOne", "Awesome")
              .uri("http://httpbin.org:80"))
              .build();
  }
  </code></pre>
  
  <p>Prior to looking at spring cloud gateway, i've also looked at Spring Netflix Zuul. I understand that in Netflix Zuul, you can create filters by creating a class that extends <code>ZuulFilter</code> and define it as a <code>pre</code>, <code>post</code>, <code>route</code>, etc.</p>
  
  <p>However I was wondering how one can create a PRE/ POST filter using Spring cloud gateway?</p>
  
  <p>Any help/ advice is much appreciated.</p>
  
  <p>Thanks.</p>