当前位置:网站首页>The postman test interface has 404 or 500 errors when the URL is configured correctly
The postman test interface has 404 or 500 errors when the URL is configured correctly
2022-07-24 00:43:00 【Look up at the ceiling】
1. use postman In the process of debugging the interface , appear 404, The annotation on the first confirmation category is @RestController

Otherwise, it will appear during the test 500

2. Determine whether there is a declaration on the method PostMapping perhaps GetMapping
3.uri Path confirmation is OK
@RestController
@RequestMapping("/test")
public class TestController {
@GetMapping // Get rid of GetMapping Will appear 404
public Result test(){
SysUser sysUser= UserThreadLocal.get();
System.out.println(sysUser);
return Result.success(null);
}
}
add @GetMapping Test success

summary :404 Resource not found , Nothing more than interface path , submission 、 Parameter type 、 There is a problem with the return result type .
And the result returned by our interface should json Formatted data , So add the @ResponseBody Or use @RestController that will do .
边栏推荐
- Reverse linked list drawing demonstration
- 测试小码农也有大目标,最新BAT大厂面试题大总结(持续更新中...)
- XXL job realizes the code parsing of email sending warnings (line by line code interpretation)
- How to speed up matrix multiplication -- optimizing GEMM (CPU single thread)
- 采坑websocket總結
- 数据标准详细概述-2022
- Bean Validation使用篇----05
- Flutter | firstwhere error reporting
- QT入门篇(2.1初入QT的开始第一个程序)
- Comparison of image preprocessing between pytorch opencv pil
猜你喜欢

Classic example of C language - find the minimum number of banknotes

How to realize 485 wireless communication between multiple sensors and Siemens PLC?

Introduction to several scenarios involving programming operation of Excel in SAP implementation project

Pbootcms database conversion tutorial (SQLite to MySQL detailed tutorial)

Redis | very important Middleware

Summary of polynomial commitment schemes

Bean Validation使用篇----05

The prediction of domestic AI protein structure reproduced a breakthrough and solved the 3D structure with a single sequence. Peng Jian's team: "the last piece of puzzle since alphafold2 has been comp

Detailed explanation of data warehouse standard -2022

Classic example of C language - convert the input two digits into English
随机推荐
Redis | very important Middleware
C language writing specification
Sed in-depth understanding and use
Redis master-slave synchronization mechanism
There are various signs that apple is expected to support AV1
Flutter | specifies the type of page return value
mysql 分支语句case报错
测试小码农也有大目标,最新BAT大厂面试题大总结(持续更新中...)
Summary of pit websocket
工作3年的测试员跳槽后工资是原来的2倍,秘诀原来是......
Network system experiment: solve the problem of Ping failure
GBase 8c 访问权限访问函数(四)
Case error of MySQL branch statement
Robot dog back submachine gun shooting video fire, netizens shivering: stoooooooopppp!
Classic examples of C language - adding two scores
Gbase 8C mode visibility query function (2)
Comparison of image preprocessing between pytorch opencv pil
书写SQL必养成的好习惯
What is promise? What are the benefits of promise
Customize an object