retrofit 2 @path Vs @query

后端 未结 6 406
暖寄归人
暖寄归人 2021-01-29 23:25

I am new to retrofit 2 library.I read several articles to get started as a beginner and I managed to fetch XML data from my RESTful API without specifying parameters.In my metho

6条回答
  •  生来不讨喜
    2021-01-30 00:11

    For example:

    @GET("/user/{username}?type={admin}")
    

    Here username is the path variable, and type is the query variable

    @GET("/user/{username}?type={admin}")
    void getUserOuth(@Path("username") String username, @Query("type") String type)
    

提交回复
热议问题