简体   繁体   中英

Paginate a request body in springboot

I have a request body in json which needs to be passed for calling another api, in this request body at max only 10 details items could be passed. Now i have 11 detail items, is there any way to paginate this request instead of copying these into two seperate request body?

    {
      "name": "abcd",
      "subject": {
        "Details": [
          {
            "point": "1"
          },
          {
            "point": "2"
          },
          {
            "point": "3"
          },
          {
            "point": "4"
          },
          {
            "point": "5"
          },
          {
            "point": "6"
          },
          {
            "point": "7"
          },
          {
            "point": "8"
          },
          {
            "point": "9"
          },
          {
            "point": "10"
          },
          {
            "point": "11"
          }
        ]
      }
    }

You must follow the rules and standards of the api that will make the request, that is, if the api accepts up to 10 records in details, you must follow this rule, otherwise, it will probably return an error/handling message.

There is no such thing as paginating a request. The endpoint can only accept 10 items at a time, so you'd need to send a second request

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