Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.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 需要复杂RestTemplate实体对象的帮助。如何使用RestTemplate构建此模板?_Java_Spring_Spring Mvc_Java 8_Resttemplate - Fatal编程技术网

Java 需要复杂RestTemplate实体对象的帮助。如何使用RestTemplate构建此模板?

Java 需要复杂RestTemplate实体对象的帮助。如何使用RestTemplate构建此模板?,java,spring,spring-mvc,java-8,resttemplate,Java,Spring,Spring Mvc,Java 8,Resttemplate,因此,我有一个需要请求主体的端点: "email": { "body": { "template": { "data": { "name": "John Doe", "verificationDate": "11-12-2020" },

因此,我有一个需要请求主体的端点:

"email": {
    "body": {
      "template": {
        "data": {
          "name": "John Doe",
          "verificationDate": "11-12-2020"
        },
        "id": 1
      }
    },
    "subject": {
      "text": "Verification Email"
    },
    "to": [
      "test@example.com"
    ]
  }

有没有人想到要在RestTemplate的RequestBody上构建它?

构建一个复杂的RequestBody与构建一个简单的RequestBody没有什么不同,只是需要更多的代码。只需按照您在构建最简单的请求主体时所做的操作即可。如果你有什么特别的问题,告诉我