Interface ApiKeyCredential.HttpConnectionFactory
- Enclosing class:
ApiKeyCredential
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Opens the HTTP connection used for an API key exchange.
Implement this interface to configure a proxy or supply a connection in tests. The
credential sets its timeout, method, headers, and request body, then disconnects it after
the exchange. For example, uri -> (HttpURLConnection)
uri.toURL().openConnection(proxy) uses an application-selected proxy.
-
Method Summary
Modifier and TypeMethodDescriptionopenConnection(URI tokenUrl) Opens an unconnected HTTP connection to the validated token URL.
-
Method Details
-
openConnection
Opens an unconnected HTTP connection to the validated token URL.- Parameters:
tokenUrl- the HTTPS token URL, or a permitted loopback HTTP URL- Returns:
- an unconnected HTTP connection owned by the credential for this exchange
- Throws:
IOException- if a connection cannot be created
-