Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
720 views
in Technique[技术] by (71.8m points)

restful API 用户登陆认证功能如何设计?http动词应该是选POST还是GET?url该如何写比较好?

restful API 用户登陆认证功能如何设计?
http动词应该是选POST还是GET?
url该如何写比较好?

大神们这个登陆模块如何设计比较好?求详细解答下,谢谢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  1. 登录一般我们都是用post方法,内容一般用formData传输,

  2. url的设计一般是你的“主路径及资源+login”,如“http://yourDomain:port/accoun...

更多的api设计方案,建议你参考为的文章:微服务指南走北(三):Restful API 设计简述


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...