FileNotFoundException при вызове API TheRockTrading - PullRequest
0 голосов
/ 22 сентября 2018

Я пытаюсь получить доступ к API TheRockTrading Exchange, но когда я пытаюсь получить доступ к личному запросу баланса, выдает FileNotFoundException

public static void main(String[] args) throws InterruptedException {
    try {
        //MANNAGGIA ALLA MADONNA

        URL a = null;
        try {
            a = new URL("https://api.therocktrading.com/v1/balance");
        } catch (MalformedURLException ex) {
            Logger.getLogger(Miner.class.getName()).log(Level.SEVERE, null, ex);
        }

        HttpsURLConnection ac = (HttpsURLConnection) a.openConnection();
        ac.setRequestMethod("GET");
        ac.setDoInput(true);
        ac.setAllowUserInteraction(false);
        ac.setRequestProperty("User-Agent", "infofetch");
        ac.setRequestProperty("Connection", "close");


        try(BufferedReader br = new BufferedReader(new InputStreamReader(ac.getInputStream()))) {
            String l = null;

            while ((l=br.readLine())!=null) {
                System.out.println(l);
            }
        } catch(IOException ioex) {
            System.err.println("IOException while reading");
            ioex.printStackTrace();
        }
    } catch (IOException ex) {
        Logger.getLogger(Miner.class.getName()).log(Level.SEVERE, null, ex);
    }
}

API-ключ и подпись отсутствуют, но я должен по крайней мере получить что-то вместо FileNotFoundException

java.io.FileNotFoundException: https://api.therocktrading.com/v1/balance
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1890)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at Miner.main(Miner.java:37)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...