通用开源 REST 客户端?
我想要一个简单的客户端,它接受一些参数(方法、URL、参数),发出 HTTP 请求,并向我显示返回的结果。
浏览器显然可以轻松发送 GET 和 POST 请求,但我对 DELETE 和 UPDATE 没有什么好主意。
我是否错过了浏览器 101 中的某些内容,或者是否有通用的免费软件工具可以执行此操作?我见过其他线程为我提供简单客户端的 Java API,但这不是我想要的。
I want a simple client that takes a few parameters (Method, URL, Parameters), makes an HTTP request, and shows me the results that were returned.
A browser obviously can easily send GET and POST requests, but I have no good ideas on DELETE and UPDATE.
Did I miss something in browser 101, or is there a common freeware tool to do this? I've seen other threads that give me Java APIs for a simple client, but that's not what I'm looking for.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
Java 应用程序rest-client http://code.google.com/p/rest-client/ 听起来是一个不错的选择。
The Java application rest-client http://code.google.com/p/rest-client/ sounds like a good option.
当我完成 REST 开发时,curl 对我来说非常出色。它足够灵活,几乎能够处理出现的任何情况,一旦您掌握了要包含哪些选项,它就非常容易使用。
When I have done REST development, curl has been excellent for me. It is flexible enough to be able to handle almost any situation that arises, and once you get the hang of which options to include, it is really easy to use.
Firefox 与 Poster 插件将执行您想要的操作。
Firefox with the Poster add-on will do what you want.
Spring有一个相当好的
RestTemplate
类,充当 REST 风格的客户端。如果您已经使用了 Spring,那就太好了,但如果您不使用 Spring,则库可能会有点庞大。注意:这似乎是一个真正的 REST 客户端,而不仅仅是在大多数情况下被视为 REST 的淡化 RPC-over-HTTP。
Spring has a rather fine
RestTemplate
class which acts as a REST-style client. Great if you already use Spring, but probably a bit of a bulky library if you don't.Note: this seems to be a genuine REST client, not just watered-down RPC-over-HTTP which is what passes for REST in most cases.
从我所在的邮件列表: curl 工作得很好。
另外,还有针对 Firefox 的海报,以及不太成熟的Chrome 的海报。
From a mailing list I'm on: curl works just fine.
Also, Poster for Firefox, and the less-mature Poster for Chrome.
Github 上有一个名为 http-console 的命令行工具,看起来不错。
链接:http://github.com/cloudhead/http-console
On Github there is a command line tool called http-console, which looks nice.
Link: http://github.com/cloudhead/http-console
最通用的选项是简单地使用 Apache HTTP 组件。请求/响应格式没有什么特别之处,就像您在 SOAP 中看到的那样,因此任何基本的 HTTP 库都可以使用。
The most generic option would be to simply use Apache HTTP Components. There is nothing special about the request/response formatting like you see in SOAP, so any basic HTTP library will work.
Curl +1,但如果你想要一个 GUI 工具,不同浏览器有很多插件,对于 Chrome,请尝试 REST 控制台: https://chrome.google.com/webstore/detail/cokgbflfommojglbmbpenpphppikmonn
+1 for Curl, but if you want a GUI tool, there are many plugins to different browsers, for Chrome try REST Console: https://chrome.google.com/webstore/detail/cokgbflfommojglbmbpenpphppikmonn
目前还没有人提到 Firefox 的 RESTClient。与 Poster 插件相比,我更喜欢它,因为它支持基本身份验证更轻松地保存/打开完整的请求。它不具备上传文件的能力,而 Poster 却具备。但如果你不需要这样做,我比我知道的其他选择更喜欢它。
No one has mentioned RESTClient for Firefox yet. I prefer it to the Poster addon because it supports basic authentication more easily, and saving/opening complete requests. What it doesn't have- and Poster does have - is the ability to upload files. But if you don't need to do that, I prefer it over the other alternatives I know.