什么是 RESTful Web 服务 [英] What are RESTful Web Services

查看:58
本文介绍了什么是 RESTful Web 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从维基百科等阅读什么 RESTful 网络服务,但我必须承认我不明白.有一部电影,丹泽尔华盛顿说像我是一个 5 岁的孩子一样向我解释它".关于 RESTful 服务,有人可以为我做这件事吗?

I've tried to read about what RESTful webservices from Wikipedia etc but I must admit I don't get it. There is a film in which Denzell Washington says "explain it to me like I'm a 5 year old". Can someone do that for me regarding RESTful services?

如果你知道电影的名字就加分.

Bonus points if you know the name of the film.

推荐答案

当我第一次开始使用 REST 时,尽管有所有文档,但我也很难了解大局".无论如何,这是我对 REST 的简要介绍:

When I first started with REST, I too had some difficulty getting the "big picture", despite all the documentation out there. Anyways, here's my brief take on REST:

  • REST 是一种用于构建 Web 服务的架构风格.

  • REST is an architectural style for building web services.

REST 建立在 HTTP 之上.您的 Web 服务以 URI 的形式公开资源.您的服务允许客户端使用标准 HTTP 动词(GET=读取资源,POST=创建资源,PUT=更新资源,DELETE=删除资源)对您的服务采取行动.

REST is built on top of HTTP. Your web service exposes Resources in the form of URIs. Your service allows clients to act upon your service using the standard HTTP verbs (GET=read the resource, POST=create the resource, PUT=update the resource, DELETE=delete the resource).

REST 在过去几年中获得了显着的发展势头,这主要是因为 (a) 与 SOAP 等其他风格相比,它更简单.(b) HTTP 无处不在.由于 HTTP 是经过时间考验的标准,因此大多数语言都具有内置或第 3 方 HTTP 支持.您不能对 SOAP 说同样的话.

REST has gained significant momentum in the past few years due largely to (a) Its simplicity over other styles like SOAP. (b) The ubiquity of HTTP. Because HTTP is a time-tested standard, most languages have build-in or 3rd-party HTTP support. You cannot say the same thing about SOAP.

因为 REST 是一种风格而不是严格的协议/规范,所以有很多解释的空间.许多自称为REST"的公共服务并没有完全遵循这种风格.

Because REST is a style and not a strict protocol/specification, there is lots of room for interpretation. Many public services that call themselves "REST" do not follow the style to the letter.

这篇关于什么是 RESTful Web 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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