使用 REST 发送文件?
像 Restlet 和 Jersey 这样的 Java REST 框架是否允许将文件作为输入发送到 Web 服务?
这将包括客户端发送文件,然后服务器接收并处理该文件。
Do Java REST frameworks like Restlet and Jersey allow one to send a file as input to a web service?
This would encompass the client sending the file and the server then receiving and processing the file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您询问是否可以对 Restlet 服务执行 HTTP PUT,那么,绝对可以。如果您只想存储文件,可以使用 Directory 类,也可以实现自己的 ServerResource 来处理新资源。
我没有使用过 Jersey,但 Restlet 是一个非常棒的 api。
If you're asking if you can do an HTTP PUT to a Restlet service, then, absolutely, yes you can. You can use the Directory class if you just want to store the file, or you can implement your own ServerResource to handle the new resource.
I haven't used Jersey, but Restlet is a fantastic api.
嗯,没有限制他们不这样做。 REST 处理文件没有任何问题。
看看:
http://mikedesjardins.us/wordpress/2007/04/restful -ftp 服务/
Well, there's no restriction for them not to do it. REST handles files without any problems.
Take a look at:
http://mikedesjardins.us/wordpress/2007/04/restful-services-on-ftp/
您还可以使用基于 HTTP 客户端构建的 REST Assured。这很简单:
You can also use REST Assured which builds on HTTP Client. It's very simple: