Class DefaultRestClient

    • Constructor Detail

      • DefaultRestClient

        public DefaultRestClient()
        Constructor
    • Method Detail

      • post

        public String post​(String url,
                           Map<String,​String> headers,
                           String jsonBody)
                    throws IOException
        Description copied from interface: RestClient
        Execute a http post call
        Specified by:
        post in interface RestClient
        Parameters:
        url - the url to the API endpoint
        headers - the headers values map
        jsonBody - the json body as string
        Returns:
        response body as string
        Throws:
        IOException - when response can not be read
      • post

        public String post​(String url,
                           Map<String,​String> headers,
                           String jsonBody,
                           int timeOutInMs)
                    throws IOException
        Description copied from interface: RestClient
        Execute a http post call
        Specified by:
        post in interface RestClient
        Parameters:
        url - the url to the API endpoint
        headers - the headers values map
        jsonBody - the json body as string
        timeOutInMs - time after which request times out
        Returns:
        response body as string
        Throws:
        IOException - when response can not be read
      • get

        public String get​(String url,
                          Map<String,​String> headers,
                          int timeOutInMs)
                   throws IOException
        Description copied from interface: RestClient
        Execute a http get call
        Specified by:
        get in interface RestClient
        Parameters:
        url - the url to the API endpoint
        headers - the headers values map
        timeOutInMs - time after which request times out
        Returns:
        response body as string
        Throws:
        IOException - when response can not be read
      • get

        public String get​(String url,
                          Map<String,​String> headers)
                   throws IOException
        Description copied from interface: RestClient
        Execute a http get call
        Specified by:
        get in interface RestClient
        Parameters:
        url - the url to the API endpoint
        headers - the headers values map
        Returns:
        response body as string
        Throws:
        IOException - when response can not be read