- 浏览: 81569 次
- 性别:
- 来自: 信阳
文章分类
- 全部博客 (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 819javascript比较出彩的运用之一:作用域链。 1、对于有 ... -
2012-2013总结之javascript
2013-05-02 14:54 0javascript能力的来源与基石是一本书:javascri ... -
Js闭包理解、运用
2012-11-08 14:12 888onClick: (function (){ ... -
URL转义及编码
2012-08-31 11:01 822js对文字进行编码涉及3个函数:escape,encodeUR ... -
JS的架构
2012-06-25 09:35 0js代码页也需要架构,他能使你的代码更加漂亮,益于维护,便于代 ... -
各种浏览器语言包、国际化如何配置
2012-04-18 15:36 2957如果web项目使用了国际化多语言包,切换浏览器语言包可以切换 ... -
RESTful初探之六(testing)
2012-04-12 17:04 992Building and testing the servic ... -
RESTful初探之五(The data layer)
2012-04-12 14:34 949原文:http://www.ibm.com/developer ... -
RESTful初探之五(Generating XML documents)
2012-04-12 13:57 910In the Formatting the resource, ... -
RESTful初探之四(Restlets)
2012-04-11 18:14 1281Restlets Restlet项目为“建立REST概念与Ja ... -
RESTful初探之二(Off to the races:Building a RESTful API)
2012-04-11 15:58 822Imagine an online application t ... -
RESTful初探之一(What is REST)
2012-04-11 11:32 959英文tutorial guide http://www.ibm ... -
关于java Web Project引包的问题
2012-02-14 17:03 1570这里要说的是Web Project如何合理引入jar包的问题。 ... -
web容器二、jetty的学习(主要接口)
2012-01-15 22:49 1064学习资料: 官方Wiki:http://docs.codeh ... -
web容器一、jetty的学习(下载源码)
2012-01-15 00:26 2389由于jetty是由java编写的web容器,因此,对web容器 ... -
servlet容器监听器与拦截器
2012-01-11 18:05 0二者都是在web.xml中加载,分别为: <listen ... -
http传参get与post的误区与总结
2012-01-11 10:18 2916众所周知的http请求有两种: get与post: 这两种请求 ... -
如何在struts2拦截器中获得request
2011-12-22 15:23 2020由struts2原理图可知道,interceptor发生在ac ...
相关推荐
Python Flask高级编程之RESTFul API前后端分离精讲第六章节Python Flask高级编程之RESTFul API前后端分离精讲第六章节Python Flask高级编程之RESTFul API前后端分离精讲第六章节Python Flask高级编程之RESTFul API...
restful restful所需要的jar包 ========================================= Restlet, a RESTful Web framework for Java ========================================= http://www.restlet.org -------------------...
### Django RESTful Web Services: The Easiest Way to Build Python #### 一、概述与背景 本书主要聚焦于如何利用Python及其最受欢迎的Web框架Django来构建RESTful Web服务。随着互联网技术的发展,RESTful Web...
Python Flask高级编程之RESTFul API前后端分离精讲第三章节Python Flask高级编程之RESTFul API前后端分离精讲第三章节Python Flask高级编程之RESTFul API前后端分离精讲第三章节Python Flask高级编程之RESTFul API...
在IT行业中,RESTful(Representational State Transfer)是一种软件架构风格,用于设计网络应用程序,尤其在Web服务领域广泛应用。C#作为.NET框架的主要编程语言,提供了丰富的工具和技术来实现RESTful服务。本篇...
1. **RESTful原则**:REST(Representational State Transfer)的核心思想是资源(Resource)和状态转移。通过HTTP方法(GET、POST、PUT、DELETE等)来操作资源,实现无状态、缓存、层叠等特性。 2. **C#与ASP.NET ...
总结来说,谷歌浏览器RESTful请求插件是开发人员必备的工具之一,尤其对于需要频繁与Elasticsearch交互的项目。通过这个插件,用户可以方便地发起REST请求,测试和调试API,同时学习和理解RESTful架构风格。无论是在...
Python Flask高级编程之RESTFul API前后端分离精讲Python Flask高级编程之RESTFul API前后端分离精讲Python Flask高级编程之RESTFul API前后端分离精讲Python Flask高级编程之RESTFul API前后端分离精讲Python Flask...
Flask-RESTful是在Flask之上构建的,它利用了Flask的路由系统,并在此之上添加了对RESTful API的额外支持。 通过以上的知识点,可以入门Flask-RESTful,编写基础的API接口。这些知识点对于初学者来说是构建Web 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
在RESTful.NET中,`restService`是核心概念之一,它代表了一个服务端的资源处理单元。通过定义RESTful接口,开发者可以构建出易于理解、可维护的API。RESTful服务通常由一组URI(统一资源标识符)组成,每个URI对应...
7. **HATEOAS(Hypermedia as the Engine of Application State)**: 虽然不是强制性的,但HATEOAS是RESTful服务的一个重要特性,它使服务更加自我描述。在Spring HATEOAS库的帮助下,我们可以轻松地添加链接到...
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...
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...
### C# 服务端调用 RestFul Service 的方法 #### 概述 本文档将详细介绍如何使用 C# 创建和调用 RESTful 接口,包括 RESTful 的基本概念、如何构建 RESTful 风格的 API、服务端的具体实现步骤以及客户端如何调用...
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 ...
### RESTful接口文档模板知识点解析 #### 一、RESTful接口概述 REST(Representational State Transfer)是一种网络应用程序的设计风格和开发方式,基于HTTP协议,可以使用XML或者JSON格式传输数据,一般用于...