最近刚开始用retrofit,在使用api接口时,对Query和Path区别一开始不了解,记录一下。
Query 是作为url的参数的,使用时类似” user/john?password=xxxx"这样,而Path是用来替换你路径里的条目的,类似“user/{username}”
参考:https://stackoverflow.com/questions/37698501/retrofit-2-path-vs-query
Query is use for URL parameters and with @Query("password") the URL should be :
user/john?password=****
Path is use to replace item defined in your path, like
user/{username}