Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does retrofit support List<Map<String,String>> int GET method #2395

Closed
ZoeTTTT opened this issue Jul 7, 2017 · 2 comments
Closed

Does retrofit support List<Map<String,String>> int GET method #2395

ZoeTTTT opened this issue Jul 7, 2017 · 2 comments

Comments

@ZoeTTTT
Copy link

ZoeTTTT commented Jul 7, 2017

like this:
@get("parents/{parent_id}/clazzs/{clazz_id}/xxx.json")
Call<List> getComments(@path("parent_id") String parentId,
@path("clazz_id") String clazzId,
@query("comment_updates[]") List<Map<String, String>> dataMap);

this will convert ":" to "=" of map in json
this is error log:unexpected token at '{clazzroom_record_id=254523, last_updated_at=2017-07-06 18:08:29}'

thx~

@JakeWharton
Copy link
Member

Retrofit will use a string converter to convert each Map to a string output for the URL. So it's supported in that sense, but there's no explicit support for maps inside a query param. If you need custom formatting register your own string converter. For more information you can ask questions on StackOverflow with the 'retrofit' tag and more information about the desired result.

@ZoeTTTT
Copy link
Author

ZoeTTTT commented Aug 2, 2017

thanks a lot! i resolved it by override the stringConverter of my project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants