如何在java android studio中导入HttpResponse?

如何在java android studio中导入HttpResponse?,java,android-studio,httpresponse,Java,Android Studio,Httpresponse,我从中找到了货币转换器的API。当我将代码粘贴到我的应用程序时,它不起作用。它看起来像这样;如何使用此API。我需要你的帮助。代码是 HttpResponse<String> response = Unirest.get("https://api.collectapi.com/economy/exchange?int=10&to=EUR&base=USD") .header("content-type", "app

我从中找到了货币转换器的API。当我将代码粘贴到我的应用程序时,它不起作用。它看起来像这样;如何使用此API。我需要你的帮助。代码是

HttpResponse<String> response = Unirest.get("https://api.collectapi.com/economy/exchange?int=10&to=EUR&base=USD")
  .header("content-type", "application/json")
  .header("authorization", "apikey 5ssaQwM0JHZphFMX2d3hIo:7sOkPGoUV7O9Xo9roXY2hN")
  .asString();
HttpResponse response=Unirest.get(“https://api.collectapi.com/economy/exchange?int=10&to=EUR&base=USD")
.header(“内容类型”、“应用程序/json”)
.标题(“授权”,“apikey 5ssaQwM0JHZphFMX2d3hIo:7sOkPGoUV7O9Xo9roXY2hN”)
.asString();

请不要将代码添加为图像。这很难读。你说得对,我正在改正