REST可以通过FTP实施吗? [英] Can REST be implemented over FTP?

查看:78
本文介绍了REST可以通过FTP实施吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的同事和我不同意REST可以通过FTP实现的说法.我相信,由于REST只是一种体系结构设计,因此可以通过具有适当接口(例如FTP)的任何协议来实现.但是,他不同意并认为当前除HTTP REST之外,无法在任何协议上实现.我向他展示了一些评论和链接,但他不接受它们.谁是正确的?

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?

关于Quora的相同问题

STOR可以跟随REST吗?

FTP Wikipedia

推荐答案

REST是一个宽泛的概念,没有任何严格的定义.只要您也控制服务器端,大多数其他协议就可以轻松地将其与HTTP一起使用的方式(即GET,POST,PUT,DELETE ..方法)轻松地镜像.对于普通的FTP服务器,这可能是不可能的(GET,PUT,DELETE可能映射到RETR,STOR和DELE,但不能映射到POST),但是FTP协议本身可以与自定义服务器一起使用,我实际上已经看到了FTP协议被误用于具有提交和回滚的事务之类的数据库(吓人!).

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!).

因此,如果您控制服务器,则可以在任何协议上实现REST的思想,从而可以双向交换数据,例如FTP,纯TCP或UDP,

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.

这篇关于REST可以通过FTP实施吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆