且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

改造:@GET 命令中的多个查询参数?

更新时间:2023-02-15 13:39:38

您应该使用以下语法:

@GET("/my/API/call")
Response getMyThing(
    @Query("param1") String param1,
    @Query("param2") String param2);

在 URL 中指定查询参数仅适用于您知道键和值并且它们是固定的.

Specifying query parameters in the URL is only for when you know both the key and value and they are fixed.