extractScheme

Description

Extracts the Uri scheme (i.e. “http”, “https”, etc.) for an incoming request.

For rejecting a request if it doesn’t match a specified scheme name, see the scheme directive.

Example

final Route route = extractScheme((scheme) -> 
                                  complete(String.format("The scheme is '%s'", scheme)));
testRoute(route).run(HttpRequest.GET("https://www.example.com/"))
  .assertEntity("The scheme is 'https'");
The source code for this page can be found here.