Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么在改装后操作中获取属性值必须为常量错误?_Java_Android_Retrofit - Fatal编程技术网

Java 为什么在改装后操作中获取属性值必须为常量错误?

Java 为什么在改装后操作中获取属性值必须为常量错误?,java,android,retrofit,Java,Android,Retrofit,我正试图将标记添加到HTTP@POST中的url字符串中,但我得到了 属性值必须为常量错误 。我不明白为什么?我正在使用改装2 ** 公共接口API{ 静态最终字符串url=(“/secure/frrest/oauth2/token/”+Prefs.getSmartPassAccessToken(App.getContext())+“?\u action=revokeTokes”); @FormUrlEncoded @帖子(url) void smartpassnonpersistentlogo

我正试图将标记添加到HTTP@POST中的url字符串中,但我得到了

属性值必须为常量错误

。我不明白为什么?我正在使用改装2

**

公共接口API{
静态最终字符串url=(“/secure/frrest/oauth2/token/”+Prefs.getSmartPassAccessToken(App.getContext())+“?\u action=revokeTokes”);
@FormUrlEncoded
@帖子(url)
void smartpassnonpersistentlogout(@Header(“内容类型”)字符串内容类型,
@字段(“客户端id”)字符串客户端id,
回调(回调);

**

您可以改用这个

public interface API { 
@FormUrlEncoded
@POST("/secure/frrest/oauth2/token/{token}")
void smartpassnonpersistentlogout(@Path("token") String token,@Query("_action")String _action,@Header("Content-Type") String content_type,
            @Field("client_id") String client_id,
            Callback<SmartPassResponse> callback);

在提问之前,请进行一些搜索。此问题已得到回答,例如此处:或此处:
public interface API { 
@FormUrlEncoded
@POST("/secure/frrest/oauth2/token/{token}")
void smartpassnonpersistentlogout(@Path("token") String token,@Query("_action")String _action,@Header("Content-Type") String content_type,
            @Field("client_id") String client_id,
            Callback<SmartPassResponse> callback);
String token=Prefs.getSmartPassAccessToken(pass_context);
yourinterface.smartpassnonpersistentlogout(token,"revokeTokens",...add remaining params);