类 NacosAsyncRestTemplate

    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void close()
      close request client.
      <T> void delete​(java.lang.String url, Header header, Query query, java.lang.reflect.Type responseType, Callback<T> callback)
      async http delete URL request params are expanded using the given query Query,
      <T> void delete​(java.lang.String url, Header header, java.lang.String body, java.lang.reflect.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.
      private <T> void execute​(java.lang.String url, java.lang.String httpMethod, RequestHttpEntity requestEntity, java.lang.reflect.Type type, Callback<T> callback)  
      <T> void get​(java.lang.String url, Header header, Query query, java.lang.reflect.Type responseType, Callback<T> callback)
      async http get URL request params are expanded using the given query Query.
      <T> void getLarge​(java.lang.String url, Header header, Query query, java.lang.Object body, java.lang.reflect.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​(java.lang.String url, Header header, Query query, java.lang.Object body, java.lang.reflect.Type responseType, Callback<T> callback)
      async http post Create a new resource by POSTing the given object to the http request.
      <T> void postForm​(java.lang.String url, Header header, Query query, java.util.Map<java.lang.String,​java.lang.String> bodyValues, java.lang.reflect.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​(java.lang.String url, Header header, java.util.Map<java.lang.String,​java.lang.String> bodyValues, java.lang.reflect.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​(java.lang.String url, Header header, Query query, java.lang.String body, java.lang.reflect.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​(java.lang.String url, Header header, java.lang.String body, java.lang.reflect.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​(java.lang.String url, Header header, Query query, java.lang.Object body, java.lang.reflect.Type responseType, Callback<T> callback)
      async http put Create a new resource by PUTting the given body to http request.
      <T> void putForm​(java.lang.String url, Header header, Query query, java.util.Map<java.lang.String,​java.lang.String> bodyValues, java.lang.reflect.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​(java.lang.String url, Header header, java.util.Map<java.lang.String,​java.lang.String> bodyValues, java.lang.reflect.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​(java.lang.String url, Header header, Query query, java.lang.String body, java.lang.reflect.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​(java.lang.String url, Header header, java.lang.String body, java.lang.reflect.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'.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • NacosAsyncRestTemplate

        public NacosAsyncRestTemplate​(org.slf4j.Logger logger,
                                      AsyncHttpClientRequest clientRequest)
    • 方法详细资料

      • get

        public <T> void get​(java.lang.String url,
                            Header header,
                            Query query,
                            java.lang.reflect.Type responseType,
                            Callback<T> callback)
        async http get 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 - url
        responseType - return type
        header - http header param
        query - http query param
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • getLarge

        public <T> void getLarge​(java.lang.String url,
                                 Header header,
                                 Query query,
                                 java.lang.Object body,
                                 java.lang.reflect.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.

        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 - url
        header - http header param
        query - http query param
        body - get with body
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • delete

        public <T> void delete​(java.lang.String url,
                               Header header,
                               Query query,
                               java.lang.reflect.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.

        参数:
        url - url
        header - http header param
        query - http query param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • delete

        public <T> void delete​(java.lang.String url,
                               Header header,
                               java.lang.String body,
                               java.lang.reflect.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.

        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 - url
        header - http header param
        body - body
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • put

        public <T> void put​(java.lang.String url,
                            Header header,
                            Query query,
                            java.lang.Object body,
                            java.lang.reflect.Type responseType,
                            Callback<T> callback)
        async http put Create a new resource by PUTting the given body to http request.

        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 - url
        header - http header param
        query - http query param
        body - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • putJson

        public <T> void putJson​(java.lang.String url,
                                Header header,
                                Query query,
                                java.lang.String body,
                                java.lang.reflect.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'.

        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 - url
        header - http header param
        query - http query param
        body - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • putJson

        public <T> void putJson​(java.lang.String url,
                                Header header,
                                java.lang.String body,
                                java.lang.reflect.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'.

        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 - url
        header - http header param
        body - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • putForm

        public <T> void putForm​(java.lang.String url,
                                Header header,
                                Query query,
                                java.util.Map<java.lang.String,​java.lang.String> bodyValues,
                                java.lang.reflect.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'.

        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 - url
        header - http header param
        query - http query param
        bodyValues - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • putForm

        public <T> void putForm​(java.lang.String url,
                                Header header,
                                java.util.Map<java.lang.String,​java.lang.String> bodyValues,
                                java.lang.reflect.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'.

        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 - url
        header - http header param
        bodyValues - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • post

        public <T> void post​(java.lang.String url,
                             Header header,
                             Query query,
                             java.lang.Object body,
                             java.lang.reflect.Type responseType,
                             Callback<T> callback)
        async http post Create a new resource by POSTing the given object to the http request.

        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 - url
        header - http header param
        query - http query param
        body - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • postJson

        public <T> void postJson​(java.lang.String url,
                                 Header header,
                                 Query query,
                                 java.lang.String body,
                                 java.lang.reflect.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'.

        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 - url
        header - http header param
        query - http query param
        body - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • postJson

        public <T> void postJson​(java.lang.String url,
                                 Header header,
                                 java.lang.String body,
                                 java.lang.reflect.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'.

        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 - url
        header - http header param
        body - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • postForm

        public <T> void postForm​(java.lang.String url,
                                 Header header,
                                 Query query,
                                 java.util.Map<java.lang.String,​java.lang.String> bodyValues,
                                 java.lang.reflect.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'.

        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 - url
        header - http header param
        query - http query param
        bodyValues - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • postForm

        public <T> void postForm​(java.lang.String url,
                                 Header header,
                                 java.util.Map<java.lang.String,​java.lang.String> bodyValues,
                                 java.lang.reflect.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'.

        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 - url
        header - http header param
        bodyValues - http body param
        responseType - return type
        callback - callback Callback.onReceive(com.alibaba.nacos.common.model.RestResult)
      • execute

        private <T> void execute​(java.lang.String url,
                                 java.lang.String httpMethod,
                                 RequestHttpEntity requestEntity,
                                 java.lang.reflect.Type type,
                                 Callback<T> callback)
      • close

        public void close()
                   throws java.lang.Exception
        close request client.
        抛出:
        java.lang.Exception