使用动词或名词的休息端点
因此,我需要创建一个休息端点,该端点基本上会在数据库中创建一个条目,即初始化客户时的地址令牌。我有两个可能的终点:
发布 - 客户/地址 - 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜第一种形式更好,更直观地知道做什么。
帖子 - 客户/地址 - 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