Search code examples
javaapirest-assuredrest-assured-jsonpath

Cannot relieve the rest assured response as String as length size is 323940. Please educate


Cannot relieve the response as string as the string length is 323940 using rest assured java

Below are the code logic used:

System.out.println(responses.getBytes().length);

When I used the below logic console output will be display as blank screen

 // System.out.println(responses.toString());

Now, what is the right logic do I need to use here so that my Json to string length 323940 will be display. Please educate.

Thanks & Regards, Sailesh Praveen


Solution

  • To convert Response type to String

    String res = response.asString();
    

    To view response in pretty json format in console

    response.prettyPrint();