- 浏览: 80004 次
- 性别:
- 来自: 信阳
文章分类
- 全部博客 (47)
- 数据库 (2)
- web应用 (14)
- 杂 (3)
- java基础 (3)
- Lucene (6)
- junit (2)
- spring (0)
- solr (4)
- JMS (0)
- 持久层 (0)
- 模板解决方案 (4)
- 项目发布管理 (0)
- GIS (0)
- 运维知识 (1)
- 设计模式 (2)
- 线程 (2)
- java.util (0)
- Linux (0)
- JVM (0)
- HTML5 (1)
- 敏捷开发 (0)
- 压力测试 (1)
- 字节码操控框架 (0)
- Classworking (1)
- EJB (1)
- REST (7)
- Restlets (4)
- Groovy (1)
- Selenium (1)
- test (3)
- Jersey一 (0)
- 架构分析 (0)
- 研发管理 (1)
- JAAS (0)
- JSCoverage (1)
- EclEmma (1)
- 计划 (0)
- jQuery (0)
- javascript MVC (0)
最新评论
-
悬空90:
兄弟人才啊 。英文不好找了老半天
web容器一、jetty的学习(下载源码) -
liushicheng1:
我也找了半天 被你发现了 人才。
web容器一、jetty的学习(下载源码) -
gandilong:
不过,我想通过ant+freemarker+xml生成jav ...
java代码自动生成一(freemarker) -
xinyangwjb:
solr官网例子默认编码是UTF-8,你的项目是不是UTF-8 ...
solr学习三(测试类,含普通与ExtractingRequestHandler测试) -
wjx:
up.setParam设置的内容如果有中文的话会乱码,不知lz ...
solr学习三(测试类,含普通与ExtractingRequestHandler测试)
Race URIs
The RESTful API you built in the preceding section for Acme Racing covers the network endpoints or URIs but not the resources.As far as REST is concerned,the format of the resources doesn't matter.as i mentioned earlier.You could pass XML or binary streams back and forth,for example.
之前的RESTful API只有网络端点或者URIs,但没有资源。跟资源格式化没有关系。你可以反复传递XML或者二进制流。
XML is arguably the lingua franca of machine-to-machine communication in the context of business transactions.so it makes sense to construct a series of XML documents that the RESTful service will support.The domain for racing is fairly simple,and you can use an existing data model,so the task of defining a few XML documents that represent races and runners is straightforward.
XML是机器通信的通用语言。所以RESTful支持XML文件。racing对象相当的简单,你可以用已存在的模型,所以直接定义XML文件来代表races和runners。
for instance,a race can be defined in XML as Listing1 :
XML实例如下
Note that a <race> has an id and that Listing1 includes a URI as part of the definition of a race.This is a key aspect of REST and indeed,the Web-resources are related and should be linked together.Accordingly,a <race> always contains a <uri> element describing its RESTful representation.The XML in Listing1 is arguably the response of a GET request to /races/1.
注意<race>有一个id并且包含一个URI作为定义race的一部分。这是Web和resources关联一起的关键。因此,一个<race>必须包括一个URI。
To create a new race,you could omit the id aspect(because managing unique IDs is something the application you're building here controls).This implies you could exclude the <uri> element as well.Consequently,a POST request would look something like Listing2
创建一个新的race,你可以忽略id(因为id指定你已经在控制台创建的应用)。这暗示了你可以不要<uri>。所以POST请求的如Listing2
What about runners? A runner is connected to race,right?So the <race>element supports holding one or more <runner> elements,as shown in Listing3
runners关联着race。所以<race>对象支持一个或多个<runner>元素。
The XML document in Listing3,for example,is what would be returned via the URI /race/race_id/runner.The API also supports CRUD operations performed on a single runner via the URI /race/race_id/runner/runner_id.
Listing3将被归还通过URI /race/race_id/runner。
Accordingly,the XML for these CRUD actions looks like Listing4:
下面是删除的写法
Note that if the race is already complete, a runner's results can be included in the XML document. Remember, using a POST request means creating a runner; consequently, the <runner> element's id attribute would not be present.
The RESTful API you built in the preceding section for Acme Racing covers the network endpoints or URIs but not the resources.As far as REST is concerned,the format of the resources doesn't matter.as i mentioned earlier.You could pass XML or binary streams back and forth,for example.
之前的RESTful API只有网络端点或者URIs,但没有资源。跟资源格式化没有关系。你可以反复传递XML或者二进制流。
XML is arguably the lingua franca of machine-to-machine communication in the context of business transactions.so it makes sense to construct a series of XML documents that the RESTful service will support.The domain for racing is fairly simple,and you can use an existing data model,so the task of defining a few XML documents that represent races and runners is straightforward.
XML是机器通信的通用语言。所以RESTful支持XML文件。racing对象相当的简单,你可以用已存在的模型,所以直接定义XML文件来代表races和runners。
for instance,a race can be defined in XML as Listing1 :
XML实例如下
<race name="Mclean 1/2 Marathon" date="2008-05-12" distance="13.1" id="1"> <uri>/races/1</uri> <description/> </race>
Note that a <race> has an id and that Listing1 includes a URI as part of the definition of a race.This is a key aspect of REST and indeed,the Web-resources are related and should be linked together.Accordingly,a <race> always contains a <uri> element describing its RESTful representation.The XML in Listing1 is arguably the response of a GET request to /races/1.
注意<race>有一个id并且包含一个URI作为定义race的一部分。这是Web和resources关联一起的关键。因此,一个<race>必须包括一个URI。
To create a new race,you could omit the id aspect(because managing unique IDs is something the application you're building here controls).This implies you could exclude the <uri> element as well.Consequently,a POST request would look something like Listing2
<race name="Limerick 2008 Half" date="2008-05-12" distance="13.4"> <description>erin go braugh and have a good time!</description> </race>
创建一个新的race,你可以忽略id(因为id指定你已经在控制台创建的应用)。这暗示了你可以不要<uri>。所以POST请求的如Listing2
What about runners? A runner is connected to race,right?So the <race>element supports holding one or more <runner> elements,as shown in Listing3
runners关联着race。所以<race>对象支持一个或多个<runner>元素。
<race name="Limerick 200 Half" date="2008-05-12" distance="13.4" id="9"> <uri>races/9</uri> <description>erin go braugh and have a good time!</description> <runners> <runner first_name="Linda" last_name="Smith" age="25" id="21"> <uri>/races/9/runner/21</uri> </runner> <runner first_name="Andrew" last_name="Glover" age="22" id="20"> <uri>/races/9/runner/20</uri> </runner> </runners> </race>
The XML document in Listing3,for example,is what would be returned via the URI /race/race_id/runner.The API also supports CRUD operations performed on a single runner via the URI /race/race_id/runner/runner_id.
Listing3将被归还通过URI /race/race_id/runner。
Accordingly,the XML for these CRUD actions looks like Listing4:
下面是删除的写法
<race name="Mclean 1/2 Marathon" date="2008-05-12" distance="13.1" id="1"> <uri>/races1</uri> <description /> <runner first_name="Andrew" last_name="Glover" age="32" id="1"> <uri>/races/1/runner/1</uri> <result time="100.04" place="45" /> </runner> </race>
Note that if the race is already complete, a runner's results can be included in the XML document. Remember, using a POST request means creating a runner; consequently, the <runner> element's id attribute would not be present.
发表评论
-
javascript异步事件分析
2013-05-22 14:25 0console.log( "a" ); ... -
javascript作用域链的灵活运用1
2013-05-21 19:58 793javascript比较出彩的运用之一:作用域链。 1、对于有 ... -
2012-2013总结之javascript
2013-05-02 14:54 0javascript能力的来源与基石是一本书:javascri ... -
Js闭包理解、运用
2012-11-08 14:12 854onClick: (function (){ ... -
URL转义及编码
2012-08-31 11:01 798js对文字进行编码涉及3个函数:escape,encodeUR ... -
JS的架构
2012-06-25 09:35 0js代码页也需要架构,他能使你的代码更加漂亮,益于维护,便于代 ... -
各种浏览器语言包、国际化如何配置
2012-04-18 15:36 2907如果web项目使用了国际化多语言包,切换浏览器语言包可以切换 ... -
RESTful初探之六(testing)
2012-04-12 17:04 968Building and testing the servic ... -
RESTful初探之五(The data layer)
2012-04-12 14:34 922原文:http://www.ibm.com/developer ... -
RESTful初探之五(Generating XML documents)
2012-04-12 13:57 888In the Formatting the resource, ... -
RESTful初探之四(Restlets)
2012-04-11 18:14 1255Restlets Restlet项目为“建立REST概念与Ja ... -
RESTful初探之二(Off to the races:Building a RESTful API)
2012-04-11 15:58 794Imagine an online application t ... -
RESTful初探之一(What is REST)
2012-04-11 11:32 937英文tutorial guide http://www.ibm ... -
关于java Web Project引包的问题
2012-02-14 17:03 1548这里要说的是Web Project如何合理引入jar包的问题。 ... -
web容器二、jetty的学习(主要接口)
2012-01-15 22:49 1011学习资料: 官方Wiki:http://docs.codeh ... -
web容器一、jetty的学习(下载源码)
2012-01-15 00:26 2293由于jetty是由java编写的web容器,因此,对web容器 ... -
servlet容器监听器与拦截器
2012-01-11 18:05 0二者都是在web.xml中加载,分别为: <listen ... -
http传参get与post的误区与总结
2012-01-11 10:18 2894众所周知的http请求有两种: get与post: 这两种请求 ... -
如何在struts2拦截器中获得request
2011-12-22 15:23 1997由struts2原理图可知道,interceptor发生在ac ...
相关推荐
restful restful所需要的jar包 ========================================= Restlet, a RESTful Web framework for Java ========================================= http://www.restlet.org -------------------...
Python Flask高级编程之RESTFul API前后端分离精讲第三章节Python Flask高级编程之RESTFul API前后端分离精讲第三章节Python Flask高级编程之RESTFul API前后端分离精讲第三章节Python Flask高级编程之RESTFul API...
Restful C# 服务端篇之实现RestFul Service开发(简单实用)
restful接口示例代码restful接口示例代码restful接口示例代码restful接口示例代码
Python Flask高级编程之RESTFul API前后端分离精讲Python Flask高级编程之RESTFul API前后端分离精讲Python Flask高级编程之RESTFul API前后端分离精讲Python Flask高级编程之RESTFul API前后端分离精讲Python Flask...
Python Flask高级编程之RESTFul API前后端分离精讲第六章节Python Flask高级编程之RESTFul API前后端分离精讲第六章节Python Flask高级编程之RESTFul API前后端分离精讲第六章节Python Flask高级编程之RESTFul API...
Create web services that are lightweight, maintainable, scalable, and secure using the best tools and techniques designed for Python About This Book Develop RESTful Web Services using the most popular...
Python Flask高级编程之RESTFul API前后端分离精讲第二章节Python Flask高级编程之RESTFul API前后端分离精讲第二章节Python Flask高级编程之RESTFul API前后端分离精讲第二章节Python Flask高级编程之RESTFul API...
thinkphp6 RESTful API开发 开发过程记录笔记 https://blog.csdn.net/weixin_41120504/article/details/115638094
1) how to make a Wavefront OBJ file that resembles a fortune cookie2) how to get fortunes using restful web reads3) how to create fortune cookie paper png image of text4) how to insert the paper image...
Building RESTful Web Services with Spring 5 – Second Edition: Leverage the power of Spring 5.0, Java SE 9, and Spring Boot 2.0 Find out how to implement the REST architecture to build resilient ...
This book is for developers who want to code RESTful web services using the Java technology stack together with any of the frameworks Jersey's JAX-RS, Restlet's Lightweight REST, JBoss's JAX-RS ...
C# 一个简单的 Restful 服务端和 Restful 客户端 Demo
go 实现Restful风格,这种风格设计让后端和前端更加友好交流,前端一看请求就知道这个api是做什么的,根本就不需要看文档,现在很多企业都在使用Restful风格设计。从Web服务客户端接收到请求后,Resource Request ...
大神的Restful Web Service ...Enable a RESTful user in the SM operator record, Enable an extaccess record to be available to a RESTful web service, Access the Service Document through a web browser,
The popularity of REST in recent years has led to tremendous growth in almost-RESTful APIs that don’t include many of the architecture’s benefits. With this practical guide, you’ll learn what it ...
Java Restful Web 源代码Java Restful Web 源代码Java Restful Web 源代码Java Restful Web 源代码Java Restful Web 源代码Java Restful Web 源代码Java Restful Web 源代码Java Restful Web 源代码Java Restful Web...
RESTFUL接口文档模板,样式好看的接口文档模板,docx格式
Spring CXF Restful 实例