一、启动失败

Apipost调用Spring boot接口-LMLPHP

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

二、访问不了接口:如果加了ComponentScan注解,则必须包含controller所在的路径Apipost调用Spring boot接口-LMLPHP

三、接口调用

1、查询

Apipost调用Spring boot接口-LMLPHP

2、新增

(1)报错,纠结于参数传递方式Apipost调用Spring boot接口-LMLPHP

(2)ApiPost支持多种请求参数类型https://doc.apipost.cn/15d046a66883807d

(3)@RequestBody注解的参数,能接收Content-Type为application/json的请求的参数值,要接收application/x-www-form-urlencoded的参数还需做点工作 https://blog.csdn.net/justry_deng/article/details/998755

(4)被@RequestBody注解的参数,既能接收Content-Type为application/json的请求的参数值,又能接收Content-Type为application/x-www-form-urlencoded的请求的参数值Apipost调用Spring boot接口-LMLPHP

Apipost调用Spring boot接口-LMLPHP

(5)上面那么麻烦,其实把RequestBody去了就好了,就没那么多事了。

3、删除

Apipost调用Spring boot接口-LMLPHP

4、更新

Apipost调用Spring boot接口-LMLPHP

11-01 08:04