小编Vic*_*cek的帖子

如何使用android注释和resttemplate在POST请求的主体中发送x-www-form-urlencoded

我的界面如下所示:

@Rest(rootUrl = "https://myurl.com", converters = { GsonHttpMessageConverter.class })
public interface CommunicatonInterface
{
@Get("/tables/login")
public Login login(Param param);
public RestTemplate getRestTemplate();
}
Run Code Online (Sandbox Code Playgroud)

问题是我应该把它作为一个简单的参数进入体内:

login=myName&password=myPassword&key=othereKey
Run Code Online (Sandbox Code Playgroud)

没有逃避,括号或配额.

我试图传递一个字符串,我只是得到: "login=myName&password=myPassword&key=othereKey"但由于配额标志,这是错误的.

java spring android resttemplate android-annotations

6
推荐指数
1
解决办法
8832
查看次数