简体   繁体   中英

Need help for complicated RestTemplate Body Object. How can I build this using RestTemplate?

So i have an endpoint that requires a request body:

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

Anybody have idea to build this on the RequestBody for RestTemplate?

Building a complicated RequestBody is nothing different from building a simple one, except that you need more code. Just do what you have done when building the simplest request body. If you have any specific problem, tell me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM