It seems that there is an issue with the response type and content type mismatch. The server is returning a response with a content type of "application/octet-stream", but the client is expecting a response of type "class java.lang.Object".\n\nTo resolve this issue, you need to configure the client to use a suitable HttpMessageConverter for the "application/octet-stream" content type. This converter will be responsible for converting the response body to the desired object type.\n\nYou can try adding the appropriate message converter to your client's RestTemplate or WebClient configuration. For example, if you are using RestTemplate, you can add the ByteArrayHttpMessageConverter to handle the "application/octet-stream" content type:\n\njava\nRestTemplate restTemplate = new RestTemplate();\nrestTemplate.getMessageConverters().add(new ByteArrayHttpMessageConverter());\n\n\nIf you are using WebClient, you can add the ByteArrayDecoder to handle the "application/octet-stream" content type:\n\njava\nWebClient webClient = WebClient.builder()\n .codecs(configurer -> configurer.defaultCodecs().register(new ByteArrayDecoder()))\n .build();\n\n\nBy adding the suitable converter, the client should be able to handle the response and convert it to the desired object type.

Spring Boot: Could not extract response: no suitable HttpMessageConverter found for response type [class java.lang.Object] and content type [application/octet-stream]

原文地址: https://www.cveoy.top/t/topic/pWvM 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录