Interface RpcTransport
- All Known Implementing Classes:
NetworkTransport
public interface RpcTransport
The one HTTP exchange every chain client needs: send a body, read the reply. The clients in
this package are written against this interface alone, so the same EvmRpc,
EsploraClient and SolanaRpc run in an application and on the backend:
- in an application,
NetworkTransportsends through theNetworkManager; - on the backend,
com.codename1.backend.WebRpcTransportsends through itsWebClient.
A test passes its own implementation that answers recorded replies.
Every call blocks until the reply arrives. On the EDT the application transport waits with
invokeAndBlock, as NetworkManager.addToQueueAndWait does, so the UI keeps painting.
-
Method Summary
-
Method Details
-
send
Sends one request and answers the response body.
Parameters
method:GETorPOSTurl: the full URLcontentType: the body's media type, ornullfor a request without onebody: the body, ornull
Throws
RpcException: for a status outside 2xx, with the status and the body the server sentIOException: when the request could not be made at all
- Throws:
IOException
-