Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java PUT请求的Spring Boot 406状态代码_Java_Spring Boot_Put_Http Status Code 406 - Fatal编程技术网

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"
}