跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[API] 一个 GET API URL 设计的有趣问题

发表于
该 GET URL 用来获取某资源
URL 内含资源标识

现要修改设计:
如果是本人创建的资源,可以获取到全部信息
如果不是本人创建的资源,可以获取到概要信息

要求:
1. 中间有道网关,以 URL 为缓存 KEY ,(因为简化了设计)不考虑 HTTP 头中的缓存控制信息 。因此相同的 URL 应该返回相同的内容
2. 不考虑把一个请求,拆分为两个。比如:先请求资源的创建者是谁,再请求资源信息
3. 开始时,客户端不知道当前用户 是不是资源的创建者
4. URL 中不能带用户标识,不然网关的缓存形同虚设


那么,这个 API URL 应该怎么设计?

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.