简体   繁体   中英

why use dot notation api endpoints?

I'm currently looking at the api for slack and some other apps and I'm seeing that they are using a . in their api endpoints . Is there a reason or benefit using the . notation in stead of / ?

Example: https://slack.com/api/chat.update

There is no intrinsic benefit of one over the other. You could equally ask why most APIs use / , in stead of end points like http://example.com/grandparent.parent.child?modifier

The most obvious reason for the existence of a path like this in the past, was file system mapping. Maybe there was a chat.update.cgi script handling the request. Those sorts of limitations no longer apply however.

Also, it seems redundant to have /api/ in the path. I would be wary of using such systems. Their authors would seem to have forgotten that your whole website is your API regardless of whether the representations are HTML or JSON.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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