【发布时间】:2020-12-09 17:52:32
【问题描述】:
org.springframework.web.client.UnknownContentTypeException:无法提取响应:没有找到适合响应类型 [class net.minidev.json.JSONObject] 和内容类型 [application/json] 的 HttpMessageConverter
public String handleRequest(ScheduledEvent event, Context context) {
LambdaLogger logger = context.getLogger();
String requestBody = System.getenv().get("REQUEST_BODY");
String endpointUrl = System.getenv().get("ENDPOINT_URL");
String authorizationHeader = System.getenv().get("AUTHORIZATION_HEADER");
ResponseEntity<JSONObject> response = restTemplate.getForEntity(endpointUrl, JSONObject.class);
logger.log(response.getBody().getAsString("Total document signed"));
String lambdaResponse = new String("200 OK");
return lambdaResponse;
}
endpointUrl 也返回 JSONObject,所以不知道为什么不匹配
【问题讨论】:
标签: spring spring-resttemplate