Class AsyncRequest


  • public abstract class AsyncRequest
    extends Object
    Wrapper for the asynchronous request api of the connectivity packages
    • Field Detail

      • logger

        protected Logger logger
      • requestId

        protected final String requestId
    • Constructor Detail

      • AsyncRequest

        public AsyncRequest​(Logger logger)
    • Method Detail

      • header

        public abstract AsyncRequest header​(String name,
                                            String value)
        Add a new http header to the request
        Parameters:
        name - The header name
        value - The header value
        Returns:
        An AsyncRequest object updated with the given header
      • method

        public abstract Future<?> method​(String method,
                                         AsyncRequestCallback callback,
                                         Object data,
                                         String contentType,
                                         boolean logIfError)
        Parameters:
        method - The http method for the request
        callback - To be called when the response is received
        data - The data to send with the request. If null, no data will be sent.
        contentType - The data content type. If null, no data will be sent.
        logIfError - If true, a detailed log will be written in case of an error.
        Returns:
        Response from the server