
2.先设置http的header->customHeader,name: Content-Type ,value: application/x-www-form-urlencoded
3.输入相应的信息:
4.返回查看信息就可以了
运行 restclient ,点选Method选项卡的“POST”方法。然后选择Body选项卡,下下拉列表中选择”String body“的选项,配置上 application/x-www-form-urlencodedcharset=UTF-8 。再出现的body里面写入字符串,也就是你的请求条件,如:query=xpsF这样就可以传递post的参数了。
java代码如下:springmvc写的
@RequestMapping(value = "/test", method = { RequestMethod.GET,
RequestMethod.POST })
public void test(HttpServletResponse response, @RequestBody String message) {
//注意这里的:@RequestBody String message
LOGGER.debug(String.format("receive message %s", message))
Map<String, String>map = Maps.newHashMap()
try {
map.put("result", message)
Tools.printToJson(JSON.toJSONString(map), response)
} catch (Exception e) {
LOGGER.error(e.getMessage(), e)
}
}
需要注意的是这个插件兼容于 Firefox 22.0 - 46.*,最新正式版下可能已经无法正常工作。打开火狐全球扩展中心,用户称搜索找到扩展页面,点击页面上的安装按钮即可完成安装。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)