- public SendTransactionTask(TaskCallback callback, MobileLedgerProfile profile) {
- taskCallback = callback;
- mProfile = profile;
- simulate = false;
+ private void sendOK(API apiVersion) throws IOException, ApiNotSupportedException {
+ HttpURLConnection http = NetworkUtil.prepareConnection(mProfile, "add");
+ http.setRequestMethod("PUT");
+ http.setRequestProperty("Content-Type", "application/json");
+ http.setRequestProperty("Accept", "*/*");
+
+ Gateway gateway = Gateway.forApiVersion(apiVersion);
+ String body = gateway.transactionSaveRequest(transaction);
+
+ Logger.debug("network", "Sending using API " + apiVersion);
+ sendRequest(http, body);