mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Refactor: Rename 'requestWithGET' to 'get'
This commit is contained in:
parent
de2ba82b3d
commit
9496691f76
@ -297,7 +297,7 @@ public class MobileNotificationService {
|
|||||||
String threadName = "sendMobileNotification-" + msgAsHex.substring(0, 5) + "...";
|
String threadName = "sendMobileNotification-" + msgAsHex.substring(0, 5) + "...";
|
||||||
ListenableFuture<String> future = executorService.submit(() -> {
|
ListenableFuture<String> future = executorService.submit(() -> {
|
||||||
Thread.currentThread().setName(threadName);
|
Thread.currentThread().setName(threadName);
|
||||||
String result = httpClient.requestWithGET(param, "User-Agent",
|
String result = httpClient.get(param, "User-Agent",
|
||||||
"bisq/" + Version.VERSION + ", uid:" + httpClient.getUid());
|
"bisq/" + Version.VERSION + ", uid:" + httpClient.getUid());
|
||||||
log.info("sendMobileNotification result: " + result);
|
log.info("sendMobileNotification result: " + result);
|
||||||
checkArgument(result.equals(SUCCESS), "Result was not 'success'. result=" + result);
|
checkArgument(result.equals(SUCCESS), "Result was not 'success'. result=" + result);
|
||||||
|
@ -45,7 +45,7 @@ public class FeeProvider extends HttpClientProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Tuple2<Map<String, Long>, Map<String, Long>> getFees() throws IOException {
|
public Tuple2<Map<String, Long>, Map<String, Long>> getFees() throws IOException {
|
||||||
String json = httpClient.requestWithGET("getFees", "User-Agent", "bisq/" + Version.VERSION);
|
String json = httpClient.get("getFees", "User-Agent", "bisq/" + Version.VERSION);
|
||||||
|
|
||||||
LinkedTreeMap<?, ?> linkedTreeMap = new Gson().fromJson(json, LinkedTreeMap.class);
|
LinkedTreeMap<?, ?> linkedTreeMap = new Gson().fromJson(json, LinkedTreeMap.class);
|
||||||
Map<String, Long> tsMap = new HashMap<>();
|
Map<String, Long> tsMap = new HashMap<>();
|
||||||
|
@ -58,7 +58,7 @@ public class PriceProvider extends HttpClientProvider {
|
|||||||
if (P2PService.getMyNodeAddress() != null)
|
if (P2PService.getMyNodeAddress() != null)
|
||||||
hsVersion = P2PService.getMyNodeAddress().getHostName().length() > 22 ? ", HSv3" : ", HSv2";
|
hsVersion = P2PService.getMyNodeAddress().getHostName().length() > 22 ? ", HSv3" : ", HSv2";
|
||||||
|
|
||||||
String json = httpClient.requestWithGET("getAllMarketPrices", "User-Agent", "bisq/"
|
String json = httpClient.get("getAllMarketPrices", "User-Agent", "bisq/"
|
||||||
+ Version.VERSION + hsVersion);
|
+ Version.VERSION + hsVersion);
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ class XmrTxProofRequest implements AssetTxProofRequest<XmrTxProofRequest.Result>
|
|||||||
"&viewkey=" + model.getTxKey() +
|
"&viewkey=" + model.getTxKey() +
|
||||||
"&txprove=1";
|
"&txprove=1";
|
||||||
log.info("Param {} for {}", param, this);
|
log.info("Param {} for {}", param, this);
|
||||||
String json = httpClient.requestWithGET(param, "User-Agent", "bisq/" + Version.VERSION);
|
String json = httpClient.get(param, "User-Agent", "bisq/" + Version.VERSION);
|
||||||
try {
|
try {
|
||||||
String prettyJson = new GsonBuilder().setPrettyPrinting().create().toJson(new JsonParser().parse(json));
|
String prettyJson = new GsonBuilder().setPrettyPrinting().create().toJson(new JsonParser().parse(json));
|
||||||
log.info("Response json from {}\n{}", this, prettyJson);
|
log.info("Response json from {}\n{}", this, prettyJson);
|
||||||
|
@ -26,9 +26,9 @@ public interface HttpClient {
|
|||||||
|
|
||||||
void setIgnoreSocks5Proxy(boolean ignoreSocks5Proxy);
|
void setIgnoreSocks5Proxy(boolean ignoreSocks5Proxy);
|
||||||
|
|
||||||
String requestWithGET(String param,
|
String get(String param,
|
||||||
@Nullable String headerKey,
|
@Nullable String headerKey,
|
||||||
@Nullable String headerValue) throws IOException;
|
@Nullable String headerValue) throws IOException;
|
||||||
|
|
||||||
String post(String param,
|
String post(String param,
|
||||||
@Nullable String headerKey,
|
@Nullable String headerKey,
|
||||||
|
@ -102,9 +102,9 @@ public class HttpClientImpl implements HttpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String requestWithGET(String param,
|
public String get(String param,
|
||||||
@Nullable String headerKey,
|
@Nullable String headerKey,
|
||||||
@Nullable String headerValue) throws IOException {
|
@Nullable String headerValue) throws IOException {
|
||||||
return doRequest(param, HttpMethod.GET, headerKey, headerValue);
|
return doRequest(param, HttpMethod.GET, headerKey, headerValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user