title: How to get Request header values in Spring Cloud Gateway
body: <p>I am implementing API routing using spring cloud gateway, in one of the use cases I need to get the header value from incoming request and use it for some processing, further add this processed value to outgoing (routed) API call as header. How to get the header value from an incoming API call in routeBuilder?</p>
  
  <pre><code>@Bean
  public RouteLocator customRouteLocator(RouteLocatorBuilder routeBuilder) {
      return routeBuilder.routes()
          .route(r -&gt; r.path("/api/v1/**")
          .setRequestHeader("testKey", "testValue")
          .uri("URL"))
          .build();
  }
  </code></pre>