0

I am trying to use Retrofit2 with GsonConverterFactory the problem is this is the response i am get from okhttp:

"{\r\n  \"Template\": {\r\n    \"id\": 11,\r\n    \"name\": \"Zoo London\"\r\n  },\r\n  \"Screens\":...

Because of this i get the following exception:

java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 2

How do i remove the special chars and carriage returns with retrofit2?

Steve
  • 427
  • 4
  • 14
  • Check the answer there. I think your question is duplicate: http://stackoverflow.com/questions/21881943/how-can-i-return-string-or-jsonobject-from-asynchronous-callback-using-retrofit – xiaoyaoworm Apr 13 '16 at 04:20

1 Answers1

-1

The problem was fixed by making sure the api was returning a valid JSON

Steve
  • 427
  • 4
  • 14