Closed pablof300 closed 5 years ago
Request is not sent upon construction of HttpRequest object using Unirest.get() method. Try using this: Unirest.get("http://api.bitcoincharts.com/v1/trades.csv").queryString("symbol","krakenUSD").queryString("start", "1504121460").asString().getBody();
When asString() is called on HttpRequest object, then request is sent and the body field is populated with the data received from server.
@rcodekaran yeah but that doesn't solve the problem. If there's no body in response, then it's populated as null an then asString()
method will throw NullPointerException, which sucks
This is fixed in an upcoming version. Ill tag this and close it when it's out.
Hello, this should be resolved or addressed in Unirest 2. Please see the upgrade guide for important changes.
I am using the version 1.4.9 in Java to accomplish a get request (http://api.bitcoincharts.com/v1/trades.csv?symbol=krakenUSD&start=1504121460)
using this code:
However, when I get the body of this request it appears as null. When I try this request myself, using Postman, it is successful?