Spring boot quickly implements restApi interface

Rest Api is a practice of separating the front and back, and is a set of standards or norms developed.

First we build a Spring boot project
Insert picture description here

Add Spring web when choosing dependencies
Insert picture description here

Set the port number to 8081
Insert picture description here

Add Controller to add @RestController and @RequestMapping annotations
Insert picture description here

Browser request interface
Insert picture description here

You can also use Postman to directly pass the value class to introduce the @RequestBody annotation
Insert picture description here

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_23140197/article/details/102514398
Recommended