Refactor: Rename 'requestWithGET' to 'get'

This commit is contained in:
chimp1984 2020-12-13 15:23:36 -05:00
parent de2ba82b3d
commit 9496691f76
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
6 changed files with 10 additions and 10 deletions

View File

@ -297,7 +297,7 @@ public class MobileNotificationService {
String threadName = "sendMobileNotification-" + msgAsHex.substring(0, 5) + "...";
ListenableFuture<String> future = executorService.submit(() -> {
Thread.currentThread().setName(threadName);
String result = httpClient.requestWithGET(param, "User-Agent",
String result = httpClient.get(param, "User-Agent",
"bisq/" + Version.VERSION + ", uid:" + httpClient.getUid());
log.info("sendMobileNotification result: " + result);
checkArgument(result.equals(SUCCESS), "Result was not 'success'. result=" + result);

View File

@ -45,7 +45,7 @@ public class FeeProvider extends HttpClientProvider {
}
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);
Map<String, Long> tsMap = new HashMap<>();

View File

@ -58,7 +58,7 @@ public class PriceProvider extends HttpClientProvider {
if (P2PService.getMyNodeAddress() != null)
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);

View File

@ -206,7 +206,7 @@ class XmrTxProofRequest implements AssetTxProofRequest<XmrTxProofRequest.Result>
"&viewkey=" + model.getTxKey() +
"&txprove=1";
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 {
String prettyJson = new GsonBuilder().setPrettyPrinting().create().toJson(new JsonParser().parse(json));
log.info("Response json from {}\n{}", this, prettyJson);

View File

@ -26,9 +26,9 @@ public interface HttpClient {
void setIgnoreSocks5Proxy(boolean ignoreSocks5Proxy);
String requestWithGET(String param,
@Nullable String headerKey,
@Nullable String headerValue) throws IOException;
String get(String param,
@Nullable String headerKey,
@Nullable String headerValue) throws IOException;
String post(String param,
@Nullable String headerKey,

View File

@ -102,9 +102,9 @@ public class HttpClientImpl implements HttpClient {
}
@Override
public String requestWithGET(String param,
@Nullable String headerKey,
@Nullable String headerValue) throws IOException {
public String get(String param,
@Nullable String headerKey,
@Nullable String headerValue) throws IOException {
return doRequest(param, HttpMethod.GET, headerKey, headerValue);
}