Android Retrofit 附加不需要的字符

4nd*_*o1d 3 android json retrofit2

我正在尝试对 json 文件执行 GET 请求:

https://www.someurl.com/appconfiguration.json

所以我使用以下 GET 方法创建了一个接口

  @GET("appconfiguration.json}")
  Call<AppConfigParent> loadAppConfigParent();
Run Code Online (Sandbox Code Playgroud)

并这样称呼它:

   final MMSATServices.AppConfigResponse appConfigResponse = new MMSATServices.AppConfigResponse();
    appConfigResponse.appConfigParent = new AppConfigParent();
    appConfigResponse.appConfigParent.configuration = null;

    Call<AppConfigParent> call = api.loadAppConfigParent();
    call.enqueue(new Callback<AppConfigParent>() {
        @Override
        public void onResponse(Call<AppConfigParent> call, Response<AppConfigParent> response) {
            appConfigResponse.appConfigParent.configuration = response.body().configuration;
            bus.post(appConfigResponse);
        }

        @Override
        public void onFailure(Call<AppConfigParent> call, Throwable t) {

        }
    });
Run Code Online (Sandbox Code Playgroud)

请注意,该api对象是在超类中定义的接口的实例。

实际问题是我收到 404 响应:

请求{method=GET,url= https://someurl.com/appconfiguration.json%7D,标签=Request{method=GET,url= https://someurl.com/appconfiguration.json%7D,tag=null } }

正如您所看到的%7D,附加到 URL 后,这会导致 404 错误。我怎样才能摆脱这种行为?

shm*_*ova 5

删除}@GET("appconfiguration.json}")