Thursday 11 May 2017

Get response body in retrofit 2 without using pojo class

  No comments
Here is the way to get response return by hitting the web api in retrofit 2 without using pojo class

Before retrofit 2.0

String bodyString = new String(((TypedByteArray) response.getBody()).getBytes());

After retrofit 2.0

 String  bodyString = new String(response.body().bytes());

No comments :

Post a Comment

Loading...