-
- All Implemented Interfaces:
-
com.uid2.network.NetworkSession
public class DefaultNetworkSession implements NetworkSession
A default implementation of NetworkSession that leverages HttpURLConnection to make the necessary GET and POST requests.
If a consuming application wants to take control over the network requests, they can implement their own custom NetworkSession and provide it when initialising the SDK via com.uid2.UID2Manager.init
-
-
Constructor Summary
Constructors Constructor Description DefaultNetworkSession()
-
Method Summary
Modifier and Type Method Description NetworkResponseloadData(URL url, NetworkRequest request)Loads the given URL and NetworkRequest using HttpURLConnection. HttpURLConnectionopenConnection(URL url)Opens the given URL to return the HttpURLConnection. -
-
Method Detail
-
loadData
NetworkResponse loadData(URL url, NetworkRequest request)
Loads the given URL and NetworkRequest using HttpURLConnection.
- Parameters:
url- The URL endpoint associated with the request.request- The details of the required request.
-
openConnection
HttpURLConnection openConnection(URL url)
Opens the given URL to return the HttpURLConnection.
This is done via an open method, to allow better testability, given that the URL class is final and therefore hard to mock itself.
-
-
-
-