资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

通过springboot写post请求-创新互联

使用工具类

 
            cn.hutool
            hutool-all
            4.3.2
        

编写请求类

@Controller
public class UploadController {

    @RequestMapping("/{page}")
    public String showPage(@PathVariable String page) {
        return page;
    }

    @GetMapping("/posthttp")
    public String postparam(String param,Model model) {
        if (param.equals("")) {
            Person single = new Person("aa", 11);
            model.addAttribute("singlePerson", single);
            model.addAttribute("postcontent", "URL没有数据");
            return "person";
        } else {
            Person single = new Person("aa", 11);
            model.addAttribute("singlePerson", single);
//        System.out.println("这是提交的参数:"+param);
            HttpRequest httpRequest = HttpRequest.get(param);
            HttpResponse execute = httpRequest.execute();
//        System.out.println("这是结果"+execute.body());
            model.addAttribute("postcontent", execute.toString());
            return "person";
        }

响应

通过springboot写post请求

目前创新互联已为超过千家的企业提供了网站建设、域名、虚拟主机绵阳服务器托管、企业网站设计、东营区网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

通过springboot写post请求

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


本文标题:通过springboot写post请求-创新互联
URL分享:http://cdkjz.cn/article/ddcege.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220