使用 RESTfull api 来创建一个处理与另一个网站的 API 交互的 Web 服务是一个好主意吗?
我想在 JSP 中创建一个网站,我必须处理另一个网站的 API,该网站在调用时会发送 XML 数据。使用 RESTfull api 是个好主意吗?
I want to create a website in JSP where I have to deal with the API of another website which sends XML data when called . Is it a good idea to use RESTfull api ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否在其他网站和您的用户之间架起了一座桥梁?
另一个网站已经发布了它的 API,你无法选择它是否是 RESTful。您被迫按原样使用那里的网络服务。您可以使用这些(可能是非 RESTful)服务,然后向您的客户端公开 RESTful 服务。
如果您问 RESTful 服务是否良好……这是一个依赖于设计的决定。有人会说这就是 Web 的本来面目,是的,您绝对应该公开 RESTful 服务。大多数人会更加务实一点,并会说这要看情况。
您能提供更多信息吗?
Are you creating a bridge between the other web site and your users?
The other website has published it's API and you have no choice if that is RESTful or not. You are forced to consume there web services as they are. You can consume those (possibly non-RESTful) services and then expose RESTful services to your clients.
If you are asking are RESTful services good...that is a design dependent decision. Some will say that is how the web was meant to be and yes you should absolutely expose RESTful services. Most will be a bit more pragmatic and will say it depends.
Can you provide any more information?