类 LocalHostUriTemplateHandler
- java.lang.Object
- org.springframework.boot.web.client.RootUriTemplateHandler
- org.springframework.boot.test.web.client.LocalHostUriTemplateHandler
- 所有已实现的接口:
org.springframework.web.util.UriTemplateHandler
public class LocalHostUriTemplateHandler extends org.springframework.boot.web.client.RootUriTemplateHandler
UriTemplateHandler
will automatically prefix relative URIs withlocalhost:${local.server.port}
.- 从以下版本开始:
- 1.4.0
构造器概要
构造器 构造器 说明 LocalHostUriTemplateHandler(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
.
构造器详细资料
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.- 参数:
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.- 参数:
environment
- the environment used to determine the portscheme
- the scheme of the root uri- 从以下版本开始:
- 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
.- 参数:
environment
- the environment used to determine the portscheme
- the scheme of the root urihandler
- the delegate handler- 从以下版本开始:
- 2.0.3
方法详细资料
getRootUri
public String getRootUri()
- 覆盖:
getRootUri
在类中org.springframework.boot.web.client.RootUriTemplateHandler