JSON file not getting downloaded, function returns null

后端 未结 3 1843
刺人心
刺人心 2021-01-24 08:34

I am trying to download some JSON from the google book API.

The URL and API-Key I\'m using seems to work becuase i can fetch it manually with a browser. I call this cl

3条回答
  •  长发绾君心
    2021-01-24 09:31

    I normally does this way,might work for you as well

    HttpResponse response = httpClient.execute(httpPost, localContext);     
    serverResponseJSON = EntityUtils.toString(response.getEntity());
    Log.i("Server Response", serverResponseJSON);
    

提交回复
热议问题