Class LocalHostUriTemplateHandler
java.lang.Object
org.springframework.boot.web.client.RootUriTemplateHandler
org.springframework.boot.test.web.client.LocalHostUriTemplateHandler
- All Implemented Interfaces:
org.springframework.web.util.UriTemplateHandler
public class LocalHostUriTemplateHandler
extends org.springframework.boot.web.client.RootUriTemplateHandler
UriTemplateHandler
will automatically prefix relative URIs with
localhost:${local.server.port}
.- Since:
- 1.4.0
-
Constructor Summary
ConstructorsConstructorDescriptionLocalHostUriTemplateHandler
(org.springframework.core.env.Environment environment) Create a newLocalHostUriTemplateHandler
that will generatehttp
URIs using the givenenvironment
to determine the context path and port.LocalHostUriTemplateHandler
(org.springframework.core.env.Environment environment, String scheme) Create a newLocalHostUriTemplateHandler
that will generate URIs with the givenscheme
and use the givenenvironment
to determine the context-path and port.LocalHostUriTemplateHandler
(org.springframework.core.env.Environment environment, String scheme, org.springframework.web.util.UriTemplateHandler handler) Create a newLocalHostUriTemplateHandler
that will generate URIs with the givenscheme
, use the givenenvironment
to 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
public LocalHostUriTemplateHandler(org.springframework.core.env.Environment environment) Create a newLocalHostUriTemplateHandler
that will generatehttp
URIs using the givenenvironment
to determine the context path and port.- Parameters:
environment
- the environment used to determine the port
-
LocalHostUriTemplateHandler
public LocalHostUriTemplateHandler(org.springframework.core.env.Environment environment, String scheme) Create a newLocalHostUriTemplateHandler
that will generate URIs with the givenscheme
and use the givenenvironment
to 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(org.springframework.core.env.Environment environment, String scheme, org.springframework.web.util.UriTemplateHandler handler) Create a newLocalHostUriTemplateHandler
that will generate URIs with the givenscheme
, use the givenenvironment
to 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:
getRootUri
in classorg.springframework.boot.web.client.RootUriTemplateHandler
-