Can REST be implemented over FTP?

2019-03-16 23:31发布

My colleague and I disagree over the statement that REST can be implemented over FTP. I believe since REST is just an architectural design, it can be implemented over any protocol with a suitable interface, e.g, FTP. However, he disagrees and believes that currently except HTTP REST can't be implemented on any protocol.I showed him a few comments and links but he isn't accepting them. Who is correct?

Same question on Quora

Can REST be followed by STOR?

FTP Wikipedia

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-03-16 23:47

REST is a broad concept without any real stringent definition. The way it is mostly used with HTTP (i.e. GET, POST, PUT, DELETE.. methods) could be easily mirrored with most other protocols, provided you control the server side too. With a normal FTP server this is probably not possible (GET, PUT, DELETE could probably be mapped to RETR, STOR and DELE, but POST not) but the FTP protocol itself could be used with a custom server and I've actually seen the FTP protocol misused for database like transactions with commit and rollback (scary!).

So if you control the server you could probably implement the ideas of REST on any protocol which makes it possible to exchange data in both directions, i.e. FTP, plain TCP or UDP, avian carrier, snail mail and maybe rainbow unicorns. But that does not mean that these protocols are really suited for this task.

查看更多
登录 后发表回答