I get the server response in this form:

suggest.apply(["Сам",[["geo","Самара, Россия","Россия, Самара ",{"hl":[[0,3]]}],["geo","Самарская область, Россия","Россия, Самарская область ",{"hl":[[0,3]]}],["geo","Самаркандский бульвар, Москва, Россия","Россия, Москва, Самаркандский бульвар ",{"hl":[[0,3]]}],["geo","улица Самуила Маршака, поселение Внуковское, Москва, Россия","Россия, Москва, поселение Внуковское, улица Самуила Маршака ",{"hl":[[6,9]]}],["geo","Самарканд, Самаркандская область, Узбекистан","Узбекистан, Самаркандская область, Самарканд ",{"hl":[[0,3],[11,14]]}],["geo","Садовая-Самотёчная улица, Москва, Россия","Россия, Москва, Садовая-Самотёчная улица ",{"hl":[[0,18,"mp"]]}],["geo","улица Саморы Машела, Москва, Россия","Россия, Москва, улица Саморы Машела ",{"hl":[[6,9]]}]]]) 

The problem is that it is wrapped in suggest.apply() and it has no headers. I can not understand how to approach him.

Can you please tell me how to disassemble it more correctly? Preferably using the library Retrofit .

    1 answer 1

    To clean the server response in Retrofit, a custom converter is used. A good example: https://stackoverflow.com/questions/26290267/retrofit-removing-some-invalid-characters-from-response-body-before-parsing-it
    And a few more examples: https://futurestud.io/tutorials/retrofit-replace-the-integrated-json-converter .
    Hope to help :)