Postman :“状态”:404、“错误”:“未找到”,“消息”:“未找到,”

tag5nh1u  于 2022-11-23  发布在  Postman
关注(0)|答案(1)|浏览(387)
@RestController()
@RequestMapping("/v1/e")
public class EC {
    @PostMapping(path = "{document}", consumes = "application/json", produces = "application/json")
    public ResponseEntity<InputStreamResource> createDocument(@PathVariable Dtype document,@RequestBody String data){
        //code
    }

我正在尝试在下面的 Postman 上发出帖子请求,这是我用来发帖的URL
请参阅
但是,我在postman上遇到以下错误

{
    "timestamp": "2020-08-05T02:22:03.008+0000",
    "status": 404,
    "error": "Not Found",
    "message": "Not Found",
    "path": "/v1/e"
}
2admgd59

2admgd591#

你也可以像下面这样使用:

@RestController
@RequestMapping("/v1/e")
public class EC {

  @PostMapping
  public ResponseEntity<?> createDocument(@RequestParam("document") String document){
      //code
  }

}

你的POST REQUESThttp://localhost:8080/v1/e?document=E_PC

相关问题