接口的使用
com.alibaba.nacos.common.http.Callback

使用Callback的程序包
  • com.alibaba.nacos.common.http.clientCallback的使用

    参数类型为Callbackcom.alibaba.nacos.common.http.client中的方法
    修饰符和类型
    方法
    说明
    <T> void
    NacosAsyncRestTemplate.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,
    <T> void
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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
    NacosAsyncRestTemplate.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'.
  • com.alibaba.nacos.common.http.client.requestCallback的使用

    修饰符和类型
    方法
    说明
    <T> void
    AsyncHttpClientRequest.execute​(URI uri, String httpMethod, RequestHttpEntity requestHttpEntity, ResponseHandler<T> responseHandler, Callback<T> callback)
    execute async http request.
    <T> void
    DefaultAsyncHttpClientRequest.execute​(URI uri, String httpMethod, RequestHttpEntity requestHttpEntity, ResponseHandler<T> responseHandler, Callback<T> callback)