0

I have this

FormatException:** FormatException: Unexpected character (at character 2) {language: en, page: 1, category: news, query:null } ^ .

It showed only Sentry.

I used chopper for RQ.
For what can it be and how fix?

@Get(path: ApiPaths.allArticles)
  Future<Response<NewsDto>> getNewsData({
    @Query('language') required String language,
    @Query('page') required int page,
    @Query('category') required String category,
    @Header('accept') String accept = 'application/json',
    @Query('query') String? query,
  });
toyota Supra
  • 3,181
  • 4
  • 15
  • 19

1 Answers1

0

It looks like it tries to parse

{language: en, page: 1, category: news, query:null }

as JSON. But this isn't valid JSON. A valid JSON string could be this instead

{"language": "en", "page": 1, "category": "news", "query":null }

I'm not sure if your api response is wrong or that you change the response to output the wrong format. But in any case it seems to try to work with the first (wrong) string.

Ivo
  • 18,659
  • 2
  • 23
  • 35