{"status":"Pulling from dev/ly-mssp-auth-ui","id":"2.2"} {"status":"Digest: sha256:065ac928d8b06e9571ca9aab52b9a5de70c45c019765c1d576c0ac748718a4ca"} {"status":"Status: Image is up to date for 192.168.2.78:5000/dev/ly-mssp-auth-ui:2.2"} 这种API接口返回的数据格式,java8用什么类型接收内容:Java 8可以使用以下方式接收这种API接口返回的数据格式: \n\njava\nimport com.fasterxml.jackson.databind.ObjectMapper;\n\n// Assuming the JSON response is stored in a string variable called "response"\nObjectMapper objectMapper = new ObjectMapper();\nMap<String, String> responseData = objectMapper.readValue(response, new TypeReference<Map<String, String>>() {});\n\n// Access the values using the keys\nString status = responseData.get("status");\nString id = responseData.get("id");\n\n\n这样可以将JSON数据解析为一个Map对象,其中键为字符串类型,值为字符串类型。可以使用键来获取相应的值。


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

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