Shopware 6产品API限制和偏移
使用Shopware 6 /api /product rest-api时,我确实会暂停。
我发现我可以设置限制和偏移。
当我用 /api /product调用API时?limit = 240& offset = 240我仍然得到第一个240个产品。
还尝试使用Shopware 5偏移量,您可以在其中使用启动而不是偏移。
两者都给出相同的结果。
我还尝试执行帖子而不是get请求,也没有成功。
我什至使用/api/搜索/产品...
有人知道如何正确执行偏移吗?
When using Shopware 6 /api/product REST-API I do get an timeout.
I found out i can set an limit and an offset.
When I call the API with /api/product?limit=240&offset=240 I still get the first 240 products.
Also tried using Shopware 5 offset variant, where you use start instead of offset.
Both give the same result.
I also tried doing an POST instead of an GET request, also no success.
I even using /api/search/product...
Does anyone know how to correctly perform an offset?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Shopware 6 API中,您可以使用
limit
和page
参数请求分页数据。page
大致转化为正在使用的偏移,而不是使用240的偏移(如示例)进行偏移请求,而是请求page = 2
带有限制为240,这将为您带来241-480的结果。因此,
您不应该使用
limit
和page
参数可以在get-requrequests中使用,但也可以在JSON-BODY或>
中使用。搜索
端点。看看文档供参考。
In the shopware 6 API you can request paginated data by using
limit
andpage
parameters. Thepage
roughly translates to the offset that is being used, instead of doing a request with an offset of 240 (as in your example) you would request thepage=2
with a limit of 240 this would give you the results 241-480.So instead of
you should use
The
limit
andpage
parameters can be used in GET-Requests, but also in POST-Request in the JSON-Body or in thesearch
endpoint.Take a look at the official docs for reference.