我正在尝试在ResponseEntity中发送OutStream但是它给了我一个错误"无法找到可接受的表示"
OutputStream stream = new ByteArrayOutputStream();
if (result.get(Orchestrator.SUCCESS_RESPONSE) != null) {
logger.info("Received successful response [{}]", result.get(Orchestrator.SUCCESS_RESPONSE));
try {
GraphSONWriter.outputGraph((Graph) result.get(Orchestrator.SUCCESS_RESPONSE), stream);
} catch (IOException e) {
e.printStackTrace();
}
/*stream = outputStream -> {
GraphSONWriter.outputGraph((Graph) result.get(Orchestrator.SUCCESS_RESPONSE), outputStream);
};*/
//return ResponseEntity.ok().header("Accept", "application/json").body(stream);
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
return new ResponseEntity<OutputStream>(stream, httpHeaders, HttpStatus.OK);
我真的很感激你的帮助,谢谢你。