简体   繁体   English

在 springboot 中对请求主体进行分页

[英]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.我在 json 中有一个请求正文,需要传递它才能调用另一个 api,在此请求正文中最多只能传递 10 个详细信息项。 Now i have 11 detail items, is there any way to paginate this request instead of copying these into two seperate request body?现在我有 11 个详细信息项,有什么方法可以对这个请求进行分页而不是将它们复制到两个单独的请求正文中吗?

    {
      "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.你必须遵循api发出请求的规则和标准,即如果api详细接受最多10条记录,你必须遵循这个规则,否则,它可能会返回一个错误/处理信息。

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端点一次只能接受 10 个项目,因此您需要发送第二个请求

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SpringBoot:请求正文与 inheritance - SpringBoot: Request body with inheritance 我在springboot的帖子正文中发送请求它不起作用 - I send request in post body in springboot it is not working 如何在SpringBoot控制器中验证请求体的字段(自定义Jackson) - How to validate fields of request body in SpringBoot controllers (customize Jackson) 如何在springboot(REST)的ExceptionHandler类中获取请求体数据 - How to get the request body data inside ExceptionHandler class in springboot(REST) 使用 SpringBoot 内置的日志服务记录完整的请求正文 - Log full request body with SpringBoot built-in logging service 如何在springboot中向请求正文添加额外属性并插入数据库 - How to add extra attributes to request body and insert into Database in springboot 带有 JSON 主体的 POST 请求不会传递到 springboot 微服务架构中的端点 - POST request with JSON body do not deliver to the endpoint in springboot microservice architecture 尝试使用 springboot 从 POST 请求正文读取嵌套 JSON 时获取空值 - Getting null when trying to read nested JSON from POST request body using springboot SpringBoot 1.5.2:我进行PUT RequestMethod时缺少必需的请求正文 - SpringBoot 1.5.2:Required request body is missing when i make PUT RequestMethod 将变量值分配为 json 并通过邮递员将其在请求正文中传递给 springboot 控制器 - Assigning a variable value as json and passing it in request body via postman to springboot controller
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM