#SpringBoot# SpringBoot接口Http协议开发

本文详细介绍了SpringBoot2.x中HTTP请求的配置,包括RESTful注解的使用,如@GetMapping、PostMapping等。此外,还讲解了PostMan接口测试工具的使用,基础HTTP接口的GET请求,以及其他HTTP方法如PUT、DELETE。文章还涵盖了Jackson处理JSON的技巧,SpringBoot目录结构,文件上传处理,以及jar包运行时的文件访问策略。
摘要由CSDN通过智能技术生成

SpringBoot2.xHTTP请求配置

SpringBoot2.xHTTP请求注解讲解和简化注解配置

  • @RestController and @RequestMapping是springMVC的注解,不是springboot特有的
  • @RestController = @Controller+@ResponseBody
  • @SpringBootApplication = @Configuration+@EnableAutoConfiguration+@ComponentScan ​localhost:8080

开发必备工具PostMan接口工具

模拟Http接口测试工具PostMan

  • 接口调试工具安装和基本使用
  • 下载地址:https://www.getpostman.com/

SpringBoot基础HTTP接口GET请求

springboot接口,http的get请求,各个注解使用
1、单一参数@RequestMapping(path = “/{id}”, method = RequestMethod.GET)

  • public String getUser(@PathVariable String id ) {}
  • @RequestMapping(path = “/{depid}/{userid}”, method = RequestMethod.GET) 可以同时指定多个提交方法 getUser(@PathVariable(“depid”) String departmentID,@PathV
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值