android - Trying to submit a URL with the '*' symbol in a Retrofit 2 API call and it won't accept it -
i trying conduct following api call, seen in postman, , successful (get call "https://www.reddit.com/subreddits/search/.json?q=nb*"):
however, when try same thing in android application using retrofit 2, api call not give desired result, instead returning empty json object (taken log):
search response subreddit string nb* , url https://www.reddit.com/subreddits/search/.json?q=nb*: {"kind":"listing","data":{"modhash":"","children":[],"after":null,"before":null}}
here retrofit interface:
@get("/subreddits/search/.json") call<jsonobject> searchsubreddits(@query(value = "q") string subredditstring);
i have tried adding encoded = true query annotation, not make difference.
update:
i have researched encoding urls , have found issue think retrofit not encode added "*" character. if replace * %2a (the url encoding "*"), in url, retrofit encodes "%2a", results in url appended "%252a", not want. want retrofit operate on url encodes * symbol appropriately.
Comments
Post a Comment