Package io.didomi.sdk.remote
Class HttpRequestHelper
-
- All Implemented Interfaces:
public class HttpRequestHelperWrapper created to abstract HTTP requests.
-
-
Field Summary
Fields Modifier and Type Field Description public final static IntegerDEFAULT_TIMEOUT
-
Constructor Summary
Constructors Constructor Description HttpRequestHelper(UserAgentRepository userAgentRepository)
-
Method Summary
Modifier and Type Method Description UnitdoGetCall(String urlString, HttpResponseListener listener, Integer timeout, Long ifModifiedSince)Method used to do GET calls UnitdoPostCall(String urlString, String content, HttpResponseListener listener, Integer timeout)Method used to do POST calls -
-
Constructor Detail
-
HttpRequestHelper
HttpRequestHelper(UserAgentRepository userAgentRepository)
-
-
Method Detail
-
doGetCall
Unit doGetCall(String urlString, HttpResponseListener listener, Integer timeout, Long ifModifiedSince)
Method used to do GET calls
- Parameters:
urlString- URL to calllistener- listener receiving request responsetimeout- request timeoutifModifiedSince- Timestamp (in ms) for the If-Modified-Since header, or 0.
-
doPostCall
Unit doPostCall(String urlString, String content, HttpResponseListener listener, Integer timeout)
Method used to do POST calls
- Parameters:
urlString- URL to callcontent- body content (mandatory)listener- listener receiving request responsetimeout- request timeout
-
-
-
-