繁体   English   中英

GET 来自 cloudflare worker 空气表代理 API 的请求以随机顺序列出对象

[英]GET Request from cloudflare worker airtable proxy API listing objects in a random order

我目前有一个 cloudflare 工作人员正在运行,并成功地从一个空气表数据库 api 向我正在为客户开发的网站发出 GET 请求。

我已经使用以下 repo 让它工作: https://github.com/portable-cto/airtable-proxy-worker

但是,由于某种原因,无论我做什么,我都无法做到,因此 GET 请求的响应按顺序列出了 airtable 中的数据(因为它在表中)。

这是请求的配置

access-control-allow-headers: authorization,content-length,content-type,user-agent,x-airtable-application-id,x-airtable-user-agent,x-api-version,x-requested-with access-control-allow-methods: DELETE,GET,OPTIONS,PATCH,POST,PUT access-control-allow-origin: * airtable-uncompressed-content-length: 4538 cache-control: max-age=0 content-length: 4538 content-type: application/json; charset=utf-8 date: Tue, 01 Feb 2022 22:06:57 GMT server: Tengine set-cookie: brw=brwJu77SKzdnETPFC; path=/; expires=Wed, 01 Feb 2023 22:06:57 GMT; domain=.airtable.com; samesite=none; secure strict-transport-security: max-age=31536000; includeSubDomains; preload vary: Accept-Encoding x-content-type-options: nosniff x-frame-options: DENY

这是响应的一部分(两个条目):

{"records":[{"id":"recXXXXXXXXXXXXX","fields":{"Title":"No. 2","Art":[{"id":"attXXXXXXXXXXXXXXX","width":1538,"height":1889,"url":"(linktoartwork)","filename":"2022-02-01 13.50.38.jpg","size":1013607,"type":"image/jpeg","thumbnails":{"small":{"url":"(linktoartwork)","width":29,"height":36},"large":{"url":"(linktoartwork)","width":512,"height":629},"full":{"url":"(linktoartwork)","width":3000,"height":3000}}}],"ArtLink":"(linktoartwork)","ID":"2","Descriptor":"'Beautiful ridicule'"},"createdTime":"2021-11-01T19:43:47.000Z"},{"id":"recXXXXXXXXXXXXX","fields":{"Title":"No. 5","Art":[{"id":"attXXXXXXXXXXXXXXX","width":1424,"height":2000,"url":"(linktoartwork)","filename":"2022-02-01 13.51.30.jpg","size":879128,"type":"image/jpeg","thumbnails":{"small":{"url":"(linktoartwork)","width":26,"height":36},"large":{"url":"(linktoartwork)","width":512,"height":719},"full":{"url":"(linktoartwork)","width":3000,"height":3000}}}],"ArtLink":"(linktoartwork)","ID":"5","Descriptor":"'Mark David'"},"createdTime":"2021-11-01T19:43:47.000Z"}

这是响应如何在网站上显示的图像预览

响应图像

在实际的数据库中,它是按递增顺序排列的(第 1 号、第 2 号等),这就是它应该列出的方式。 我最初使用的 nocodeapi就是这样做的,但它有一个速率限制。 这个代理更适合我的 API 的多少控制 Id,但我需要它正确列出。

暂无
暂无

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

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