Class LocalHostUriTemplateHandler
java.lang.Object
org.springframework.boot.web.client.RootUriTemplateHandler
org.springframework.boot.test.web.client.LocalHostUriTemplateHandler
- All Implemented Interfaces:
UriTemplateHandler
UriTemplateHandler will automatically prefix relative URIs with
localhost:${local.server.port}.- Since:
- 1.4.0
- Author:
- Phillip Webb, Andy Wilkinson, EddĂș MelĂ©ndez, Madhura Bhave
-
Constructor Summary
ConstructorsConstructorDescriptionLocalHostUriTemplateHandler(Environment environment) Create a newLocalHostUriTemplateHandlerthat will generatehttpURIs using the givenenvironmentto determine the context path and port.LocalHostUriTemplateHandler(Environment environment, String scheme) Create a newLocalHostUriTemplateHandlerthat will generate URIs with the givenschemeand use the givenenvironmentto determine the context-path and port.LocalHostUriTemplateHandler(Environment environment, String scheme, UriTemplateHandler handler) Create a newLocalHostUriTemplateHandlerthat will generate URIs with the givenscheme, use the givenenvironmentto determine the context-path and port and delegate to the given templatehandler. -
Method Summary
Methods inherited from class org.springframework.boot.web.client.RootUriTemplateHandler
addTo, expand, expand, withHandlerWrapper
-
Constructor Details
-
LocalHostUriTemplateHandler
Create a newLocalHostUriTemplateHandlerthat will generatehttpURIs using the givenenvironmentto determine the context path and port.- Parameters:
environment- the environment used to determine the port
-
LocalHostUriTemplateHandler
Create a newLocalHostUriTemplateHandlerthat will generate URIs with the givenschemeand use the givenenvironmentto determine the context-path and port.- Parameters:
environment- the environment used to determine the portscheme- the scheme of the root uri- Since:
- 1.4.1
-
LocalHostUriTemplateHandler
public LocalHostUriTemplateHandler(Environment environment, String scheme, UriTemplateHandler handler) Create a newLocalHostUriTemplateHandlerthat will generate URIs with the givenscheme, use the givenenvironmentto determine the context-path and port and delegate to the given templatehandler.- Parameters:
environment- the environment used to determine the portscheme- the scheme of the root urihandler- the delegate handler- Since:
- 2.0.3
-
-
Method Details
-
getRootUri
- Overrides:
getRootUriin classRootUriTemplateHandler
-