Class RequestUtils
java.lang.Object
com.github.prominence.openweathermap.api.utils.RequestUtils
Utility class for API calls execution.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetResponse(RequestSettings requestSettings) static StringgetResponse(String url) Executes call to provided API url and retrieves response inStringrepresentation.static StringgetResponse(String url, TimeoutSettings timeoutSettings) Executes call to provided API url and retrieves response inStringrepresentation.
-
Method Details
-
getResponse
-
getResponse
Executes call to provided API url and retrieves response inStringrepresentation.- Parameters:
url- the url to make API request.- Returns:
- response from the request in
Stringrepresentation. - Throws:
IllegalArgumentException- in case if provided parameter isn't a valid url forURLinstance.
-
getResponse
Executes call to provided API url and retrieves response inStringrepresentation.- Parameters:
url- the url to make API request.timeoutSettings- an object with timeout settings.- Returns:
- response from the request in
Stringrepresentation. - Throws:
IllegalArgumentException- in case if provided parameter isn't a valid url forURLinstance.
-