代码拉取完成,页面将自动刷新
同步操作将从 捣鼓/forest 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
方法一:使用${数字}的方式引用对应顺序的参数
@Request(
url = "${0}/send?un=${1}&pw=${2}&da=${3}&sm=${4}",
type = "get",
dataType = "json"
)
public Map send(
String base,
String userName,
String password,
String phoneList,
String content
);
client.send("http://localhost:8080", "DT", "123456", "123888888", "Hahaha");
// 最终会产生以下链接并访问
// http://localhost:8080/send?un=DT&pw=123456&da=123888888&sm=Hahaha
方法二:使用@DataParam标签, 自动产生url参数
@Request(
url = "${0}/send",
type = "get",
dataType = "json"
)
public Map send(
String base,
@DataParam("un") String userName,
@DataParam("pw") String password,
@DataParam("da") String phoneList,
@DataParam("sm") String content
);
client.send("http://localhost:8080", "DT", "123456", "123888888", "Hahaha");
// 效果同上,最终会产生以下链接并访问
// http://localhost:8080/send?un=DT&pw=123456&da=123888888&sm=Hahaha
方法三:使用@DataVariable标签定义变量名,然后引用通过${变量名}的方式引用
@Request(
url = "${base}/send?un=${un}&pw=${pw}&da=${da}&sm=${sm}",
type = "get",
dataType = "json"
)
public Map send(
@DataVariable("base") String base,
@DataVariable("un") String userName,
@DataVariable("pw") String password,
@DataVariable("da") String phoneList,
@DataVariable("sm") String content
);
client.send("http://localhost:8080", "DT", "123456", "123888888", "Hahaha");
// 效果同上,最终会产生以下链接并访问
// http://localhost:8080/send?un=DT&pw=123456&da=123888888&sm=Hahaha
方法四:设置全局变量,然后引用通过${变量名}的方式引用
@Request(
url = "${baseShortUrl}/create.php",
type = "post",
dataType = "json"
)
Map testVar(@DataParam("url") String url);
ForestConfiguration configuration = ForestConfiguration.configuration();
configuration.setVariableValue("baseShortUrl", "http://dwz.cn");
Www www = configuration.createInstance(Www.class);
Map result = www.testVar("https://github.com/mySingleLive");
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。