Restlet API 示例 [英] Restlet API example

查看:39
本文介绍了Restlet API 示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有使用 Java 的 Restlet API 的简单示例?

Is there any simple example of Restlet API with Java?

我想要一个通过调用 Get/POST 方法的 Restlet API 的简单示例.一个客户端应该通过 Restlet 从服务器调用一种方法.服务器应该执行该方法并相应地发送回复.服务器如何打开这些方法来响应客户端使用 Restlet?

I want a simple example of Restlet API by calling Get / POST method. One client should call one method from the server through Restlet. The server should execute that method and send the reply accordingly. How can the server open those methods to respond to the client using Restlet?

推荐答案

您可能需要考虑查看 http://www.restlet.org/documentation/ 项目提供的文档为开始使用代码提供了很好的示例.

You may want to consider looking at http://www.restlet.org/documentation/ the documentation provided by the project provides good examples to get started with using the code.

版本 2.1 目前是稳定的分支,@Get、@Post 等注释可用于您的 ServerResource,提供比 Divyesh 概述的稍微灵活的方法,尽管我相信这种方法仍然可用.

Version 2.1 is currently the stable branch and the @Get, @Post, etc. annotations, available to be used on your ServerResource, provide a slightly more flexible approach than outlined by Divyesh, although that approach is I believe still also available.

这篇关于Restlet API 示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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