Class RequestUtils

java.lang.Object
com.github.prominence.openweathermap.api.utils.RequestUtils

public final class RequestUtils extends Object
Utility class for API calls execution.
  • Method Details

    • getResponse

      public static String getResponse(RequestSettings requestSettings)
    • getResponse

      public static String getResponse(String url)
      Executes call to provided API url and retrieves response in String representation.
      Parameters:
      url - the url to make API request.
      Returns:
      response from the request in String representation.
      Throws:
      IllegalArgumentException - in case if provided parameter isn't a valid url for URL instance.
    • getResponse

      public static String getResponse(String url, TimeoutSettings timeoutSettings)
      Executes call to provided API url and retrieves response in String representation.
      Parameters:
      url - the url to make API request.
      timeoutSettings - an object with timeout settings.
      Returns:
      response from the request in String representation.
      Throws:
      IllegalArgumentException - in case if provided parameter isn't a valid url for URL instance.