Java PUT请求的Spring Boot 406状态代码
代码是 有什么解决办法?Java PUT请求的Spring Boot 406状态代码,java,spring-boot,put,http-status-code-406,Java,Spring Boot,Put,Http Status Code 406,代码是 有什么解决办法? 谢谢您确定这是正确的控制器吗?因为这个路径“/{id}/{route}/structure_article/{filename:.+}”看起来不像图像上的路径,请求是什么??特别是Acceptheader。是的,请求的端点与此处指定的端点不同(缺少结构)。我编辑了图像。你确定这是正确的控制器吗?因为这个路径“/{id}/{route}/structure_article/{filename:.+}”看起来不像图像上的路径,请求是什么??特别是Acceptheader。是
谢谢您确定这是正确的控制器吗?因为这个路径“/{id}/{route}/structure_article/{filename:.+}”看起来不像图像上的路径,请求是什么??特别是
Accept
header。是的,请求的端点与此处指定的端点不同(缺少结构)。我编辑了图像。你确定这是正确的控制器吗?因为这个路径“/{id}/{route}/structure_article/{filename:.+}”看起来不像图像上的路径,请求是什么??特别是Accept
header。是的,请求的端点与这里指定的端点不同(缺少结构)。我编辑了图像
@RestController
@Component
@Slf4j
public class ServicesController {
@CrossOrigin
@PutMapping(
consumes = "multipart/form-data",
path = "/{id}/{route}/structure_article/{filename:.+}")
public ResponseEntity<ServiceResponse> updateStructureXMLFile(
@PathVariable("id") final String id,
@PathVariable("route") final String route,
@RequestParam("file") final MultipartFile uploadfile,
@PathVariable("filename") final String fileName) throws IOException {
(Some processing)
return new ResponseEntity<>(response, httpHeaders, HttpStatus.CREATED);
}
}
{
"timestamp": 1596783608973,
"status": 406,
"error": "Not Acceptable",
"exception": "org.springframework.web.HttpMediaTypeNotAcceptableException",
"message": "Could not find acceptable representation",
"path": "/7f3033d7-3979-45e0-9f0a-172b60568edb/articles/structure_article/manuscript.xml"
}