Class ServerHttpAgent
- java.lang.Object
-
- com.alibaba.nacos.client.config.http.ServerHttpAgent
-
-
Constructor Summary
Constructors Constructor Description ServerHttpAgent(ServerListManager mgr)ServerHttpAgent(ServerListManager mgr, Properties properties)ServerHttpAgent(Properties properties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgetAppname()StringgetEncode()get encodeStringgetName()get nameStringgetNamespace()get namespaceStringgetTenant()get tenantHttpSimpleClient.HttpResulthttpDelete(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs)invoke http delete methodHttpSimpleClient.HttpResulthttpGet(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs)invoke http get methodHttpSimpleClient.HttpResulthttpPost(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs)invoke http post methodvoidstart()start to get nacos ip list
-
-
-
Constructor Detail
-
ServerHttpAgent
public ServerHttpAgent(ServerListManager mgr)
-
ServerHttpAgent
public ServerHttpAgent(ServerListManager mgr, Properties properties)
-
ServerHttpAgent
public ServerHttpAgent(Properties properties) throws com.alibaba.nacos.api.exception.NacosException
- Throws:
com.alibaba.nacos.api.exception.NacosException
-
-
Method Detail
-
httpGet
public HttpSimpleClient.HttpResult httpGet(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException
Description copied from interface:HttpAgentinvoke http get method- Specified by:
httpGetin interfaceHttpAgent- Parameters:
path- 相对于web应用根,以/开头headers-paramValues-encoding-readTimeoutMs-- Returns:
- Throws:
IOException
-
httpPost
public HttpSimpleClient.HttpResult httpPost(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException
Description copied from interface:HttpAgentinvoke http post method- Specified by:
httpPostin interfaceHttpAgent- Parameters:
path- http pathheaders- http headersparamValues- http paramValues httpencoding- http encodereadTimeoutMs- http timeout- Returns:
- HttpResult http response
- Throws:
IOException- If an input or output exception occurred
-
httpDelete
public HttpSimpleClient.HttpResult httpDelete(String path, List<String> headers, List<String> paramValues, String encoding, long readTimeoutMs) throws IOException
Description copied from interface:HttpAgentinvoke http delete method- Specified by:
httpDeletein interfaceHttpAgent- Parameters:
path- http pathheaders- http headersparamValues- http paramValues httpencoding- http encodereadTimeoutMs- http timeout- Returns:
- HttpResult http response
- Throws:
IOException- If an input or output exception occurred
-
getAppname
public static String getAppname()
-
start
public void start() throws com.alibaba.nacos.api.exception.NacosExceptionDescription copied from interface:HttpAgentstart to get nacos ip list
-
getNamespace
public String getNamespace()
Description copied from interface:HttpAgentget namespace- Specified by:
getNamespacein interfaceHttpAgent- Returns:
- String
-
-