Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/364.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 如何借助WebClient从服务器获取JSON响应?_Java_Json_Rest_Kotlin_Spring Webclient - Fatal编程技术网

Java 如何借助WebClient从服务器获取JSON响应?

Java 如何借助WebClient从服务器获取JSON响应?,java,json,rest,kotlin,spring-webclient,Java,Json,Rest,Kotlin,Spring Webclient,例如,服务器在JSON表示中返回以下错误: { "errorMessage": "Table already exists: ProductFgh (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ResourceInUseException; Request ID: 6S14VS0E6ESUMG55DL937IC42JVV4KQNSO5AEMVJF66Q9ASUAAJG)",

例如,服务器在JSON表示中返回以下错误:

{
    "errorMessage": "Table already exists: ProductFgh (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ResourceInUseException; Request ID: 6S14VS0E6ESUMG55DL937IC42JVV4KQNSO5AEMVJF66Q9ASUAAJG)",
    "timeStamp": "2020-Jan-22 11:53:58",
    "errorCode": 500,
    "projectName": "DynamoDB",
    "servicePath": "http://localhost:8090/DynamoDb/createTable",
    "controllerName": "class com.example.DynamoDB.DynamoDBController",
    "serviceName": "createExampleTable"
}
我的web客户端请求配置如下:

    suspend fun getResponseFromServer(): ResponseEntity<*> {
        return webClient
                .get()
                .uri { ... }
                .awaitExchange()
                .awaitEntity()
    }
suspend fun getResponseFromServer():ResponseEntity{
返回网络客户端
.get()
.uri{…}
.交换
.1.实体()
}
如何设置web客户端以使其接收服务器的JSON响应? 我检查了以前的解决方案,但它们似乎已经过时,因为它们都不起作用

请提示我