Skip to content

Commit de102ed

Browse files
committed
Fix HTTP connection
1 parent 62ca052 commit de102ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/danubetech/btc/connection/impl/EsploraElectrsRESTBitcoinConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ private static String readString(URI uri) {
150150
StringBuilder inputBuffer = new StringBuilder();
151151
try {
152152
connection = (HttpURLConnection) uri.toURL().openConnection();
153-
int httpStatus = connection.getResponseCode();
154153
connection.setRequestMethod("GET");
155154
connection.setDoInput(true);
156155
connection.setDoOutput(false);
156+
int httpStatus = connection.getResponseCode();
157157
if (httpStatus != HttpURLConnection.HTTP_OK) {
158158
StringBuilder errorBuffer = new StringBuilder();
159159
try (InputStream errorStream = connection.getErrorStream()) {

0 commit comments

Comments
 (0)