public class NacosAsyncRestTemplate extends AbstractNacosRestTemplate
AsyncHttpClientRequest,
HttpClientResponselogger| 构造器和说明 |
|---|
NacosAsyncRestTemplate(org.slf4j.Logger logger,
AsyncHttpClientRequest clientRequest) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
close request client.
|
<T> void |
delete(String url,
Header header,
Query query,
Type responseType,
Callback<T> callback)
async http delete URL request params are expanded using the given query
Query,
responseType can be an RestResult or RestResult data T type
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult. |
<T> void |
delete(String url,
Header header,
String body,
Type responseType,
Callback<T> callback)
async http delete large request, when the parameter exceeds the URL limit, you can use this method to put the
parameter into the body pass.
|
<T> void |
get(String url,
Header header,
Query query,
Type responseType,
Callback<T> callback)
async http get URL request params are expanded using the given query
Query. |
<T> void |
getLarge(String url,
Header header,
Query query,
Object body,
Type responseType,
Callback<T> callback)
async get request, may be pulling a lot of data URL request params are expanded using the given query
Query, More request parameters can be set via body. |
<T> void |
post(String url,
Header header,
Query query,
Object body,
Type responseType,
Callback<T> callback)
async http post Create a new resource by POSTing the given object to the http request.
|
<T> void |
postForm(String url,
Header header,
Map<String,String> bodyValues,
Type responseType,
Callback<T> callback)
async http post from Create a new resource by PUTting the given map
bodyValues to http request, http
header contentType default 'application/x-www-form-urlencoded;charset=utf-8'. |
<T> void |
postForm(String url,
Header header,
Query query,
Map<String,String> bodyValues,
Type responseType,
Callback<T> callback)
async http post from Create a new resource by PUTting the given map
bodyValues to http request, http
header contentType default 'application/x-www-form-urlencoded;charset=utf-8'. |
<T> void |
postJson(String url,
Header header,
Query query,
String body,
Type responseType,
Callback<T> callback)
async http post Json Create a new resource by POSTing the given object to the http request, http header
contentType default 'application/json;charset=UTF-8'.
|
<T> void |
postJson(String url,
Header header,
String body,
Type responseType,
Callback<T> callback)
async http post Json Create a new resource by POSTing the given object to the http request, http header
contentType default 'application/json;charset=UTF-8'.
|
<T> void |
put(String url,
Header header,
Query query,
Object body,
Type responseType,
Callback<T> callback)
async http put Create a new resource by PUTting the given body to http request.
|
<T> void |
putForm(String url,
Header header,
Map<String,String> bodyValues,
Type responseType,
Callback<T> callback)
async http put from Create a new resource by PUTting the given map
bodyValues to http request, http
header contentType default 'application/x-www-form-urlencoded;charset=utf-8'. |
<T> void |
putForm(String url,
Header header,
Query query,
Map<String,String> bodyValues,
Type responseType,
Callback<T> callback)
async http put from Create a new resource by PUTting the given map
bodyValues to http request, http
header contentType default 'application/x-www-form-urlencoded;charset=utf-8'. |
<T> void |
putJson(String url,
Header header,
Query query,
String body,
Type responseType,
Callback<T> callback)
async http put Json Create a new resource by PUTting the given body to http request, http header contentType
default 'application/json;charset=UTF-8'.
|
<T> void |
putJson(String url,
Header header,
String body,
Type responseType,
Callback<T> callback)
async http put Json Create a new resource by PUTting the given body to http request, http header contentType
default 'application/json;charset=UTF-8'.
|
registerResponseHandler, selectResponseHandlerpublic NacosAsyncRestTemplate(org.slf4j.Logger logger,
AsyncHttpClientRequest clientRequest)
public <T> void get(String url, Header header, Query query, Type responseType, Callback<T> callback)
Query.
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlresponseType - return typeheader - http header paramquery - http query paramcallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void getLarge(String url, Header header, Query query, Object body, Type responseType, Callback<T> callback)
Query, More request parameters can be set via body.
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header paramquery - http query parambody - get with bodyresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void delete(String url, Header header, Query query, Type responseType, Callback<T> callback)
Query,
responseType can be an RestResult or RestResult data T type
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header paramquery - http query paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void delete(String url, Header header, String body, Type responseType, Callback<T> callback)
responseType can be an RestResult or RestResult data T type
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header parambody - bodyresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void put(String url, Header header, Query query, Object body, Type responseType, Callback<T> callback)
URL request params are expanded using the given query Query.
responseType can be an RestResult or RestResult data T type
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header paramquery - http query parambody - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void putJson(String url, Header header, Query query, String body, Type responseType, Callback<T> callback)
URL request params are expanded using the given query Query.
responseType can be an RestResult or RestResult data T type
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header paramquery - http query parambody - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void putJson(String url, Header header, String body, Type responseType, Callback<T> callback)
responseType can be an RestResult or RestResult data T type
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header parambody - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void putForm(String url, Header header, Query query, Map<String,String> bodyValues, Type responseType, Callback<T> callback)
bodyValues to http request, http
header contentType default 'application/x-www-form-urlencoded;charset=utf-8'.
URL request params are expanded using the given query Query.
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header paramquery - http query parambodyValues - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void putForm(String url, Header header, Map<String,String> bodyValues, Type responseType, Callback<T> callback)
bodyValues to http request, http
header contentType default 'application/x-www-form-urlencoded;charset=utf-8'.
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header parambodyValues - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void post(String url, Header header, Query query, Object body, Type responseType, Callback<T> callback)
URL request params are expanded using the given query Query.
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header paramquery - http query parambody - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void postJson(String url, Header header, Query query, String body, Type responseType, Callback<T> callback)
URL request params are expanded using the given query Query.
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header paramquery - http query parambody - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void postJson(String url, Header header, String body, Type responseType, Callback<T> callback)
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header parambody - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void postForm(String url, Header header, Query query, Map<String,String> bodyValues, Type responseType, Callback<T> callback)
bodyValues to http request, http
header contentType default 'application/x-www-form-urlencoded;charset=utf-8'.
URL request params are expanded using the given query Query.
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header paramquery - http query parambodyValues - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)public <T> void postForm(String url, Header header, Map<String,String> bodyValues, Type responseType, Callback<T> callback)
bodyValues to http request, http
header contentType default 'application/x-www-form-urlencoded;charset=utf-8'.
responseType can be an RestResult or RestResult data T type.
callback Result callback execution,
if you need response headers, you can convert the received RestResult to HttpRestResult.
url - urlheader - http header parambodyValues - http body paramresponseType - return typecallback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)Copyright © 2018–2021 Alibaba Group. All rights reserved.