使用动词或名词的休息端点

发布于 2025-02-12 02:35:29 字数 171 浏览 1 评论 0原文

因此,我需要创建一个休息端点,该端点基本上会在数据库中创建一个条目,即初始化客户时的地址令牌。我有两个可能的终点:

发布 - 客户/地址 - token-这是为用户

帖子创建一个地址 - 客户/初始化 -

我想我应该使用以前还是后者?我已经阅读了一些主题,其中后者称为控制器资源类型?

so i need to create a rest endpoint that basically creates an entry in the database, a address token when the customer is initialised. I have two possible endpoints:

POST - customer/address-token - this creates a address for a user

POST - customer/initialise -

im thinking should i use the former or latter? I have read a few topics on this, whereby the latter is a termed a controller resource type?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

违心° 2025-02-19 02:35:29

我猜第一种形式更好,更直观地知道做什么。

帖子 - 客户/地址 - token-这为用户创建地址

I guess the first form is better and more intuitive to know what are do.

POST - customer/address-token - this creates a address for a user

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文