Interface RestClient

  • All Known Implementing Classes:
    DefaultRestClient

    public interface RestClient
    Rest client for communicating with the Eventsource-Gateway (a.k.a Asgard) RESTful API
    Author:
    arotaru
    • Method Detail

      • post

        String post​(String url,
                    Map<String,​String> headers,
                    String jsonBody,
                    int timeOutInMs)
             throws IOException
        Execute a http post call
        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
      • post

        String post​(String url,
                    Map<String,​String> headers,
                    String jsonBody)
             throws IOException
        Execute a http post call
        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
      • get

        String get​(String url,
                   Map<String,​String> headers,
                   int timeOutInMs)
            throws IOException
        Execute a http get call
        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

        String get​(String url,
                   Map<String,​String> headers)
            throws IOException
        Execute a http get call
        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