REST

利用HipSTR从二代测序数据中精准解析短串联重复序列(STR)的遗传多态性 本文详细介绍了如何利用HipSTR工具从二代测序(NGS)数据中精准解析短串联重复序列(STR)的遗传多态性。通过三步走策略,HipSTR能够高效识别STR区域、估算重复次数并判定基因型,适用于法医鉴定、疾病研究和细胞系鉴定等多个领域。文章还提供了实战操作指南和常见问题解决方案,帮助研究者充分利用NGS数据开展STR分析。 阅读详情

Building Web Services the REST Way

Roger L. Costello

I will first provide a brief introduction to REST and then describe how to build Web services in the REST style.

What is REST?

REST is a term coined by Roy Fielding in his Ph.D. dissertation [1] to describe an architecture style of networked systems. REST is an acronym standing for Representational State Transfer.

Why is it called Representational State Transfer?

The Web is comprised of resources. A resource is any item of interest. For example, the Boeing Aircraft Corp may define a 747 resource. Clients may access that resource with this URL:

 

http://www.boeing.com/aircraft/747
A representation of the resource is returned (e.g., Boeing747.html). The representation places the client application in a state. The result of the client traversing a hyperlink in Boeing747.html is another resource is accessed. The new representation places the client application into yet another state. Thus, the client application changes (transfers) state with each resource representation --> Representational State Transfer!

 

Here is Roy Fielding's explanation of the meaning of Representational State Transfer:

 

"Representational State Transfer is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use."

Motivation for REST

The motivation for REST was to capture the characteristics of the Web which made the Web successful. Subsequently these characteristics are being used to guide the evolution of the Web.

REST - An Architectural Style, Not a Standard

REST is not a standard. You will not see the W3C putting out a REST specification. You will not see IBM or Microsoft or Sun selling a REST developer's toolkit. Why? Because REST is just an architectural style. You can't bottle up that style. You can only understand it, and design your Web services in that style. (Analogous to the client-server architectural style. There is no client-server standard.)

 

While REST is not a standard, it does use standards:
  • HTTP
  • URL
  • XML/HTML/GIF/JPEG/etc (Resource Representations)
  • text/xml, text/html, image/gif, image/jpeg, etc (MIME Types)

The Classic REST System

The Web is a REST system! Many of those Web services that you have been using these many years - book-ordering services, search services, online dictionary services, etc - are REST-based Web services. Alas, you have been using REST, building REST services and you didn't even know it.

 

REST is concerned with the "big picture" of the Web. It does not deal with implementation details (e.g., using Java servlets or CGI to implement a Web service). So let's look at an example of creating a Web service from the REST "big picture" perspective.

Parts Depot Web Services

Parts Depot, Inc (fictitious company) has deployed some web services to enable its customers to:
  • get a list of parts
  • get detailed information about a particular part
  • submit a Purchase Order (PO)
Let's consider how each of these services are implemented in a RESTful fashion.

Get Parts List

The web service makes available a URL to a parts list resource. For example, a client would use this URL to get the parts list:

 

http://www.parts-depot.com/parts
Note that "how" the web service generates the parts list is completely transparent to the client. All the client knows is that if he/she submits the above URL then a document containing the list of parts is returned. Since the implementation is transparent to clients, Parts Depot is free to modify the underlying implementation of this resource without impacting clients. This is loose coupling.

Here's the document that the client receives:

 

<?xml version="1.0"?>
<p:Parts xmlns:p="http://www.parts-depot.com" 
         xmlns:xlink="http://www.w3.org/1999/xlink">
      <Part id="00345" xlink:href="http://www.parts-depot.com/parts/00345"/>
      <Part id="00346" xlink:href="http://www.parts-depot.com/parts/00346"/>
      <Part id="00347" xlink:href="http://www.parts-depot.com/parts/00347"/>
      <Part id="00348" xlink:href="http://www.parts-depot.com/parts/00348"/>
</p:Parts>
[Assume that through content negotiation the service determined that the client wants the representation as XML (for machine-to-machine processing).] Note that the parts list has links to get detailed info about each part. This is a key feature of REST. The client transfers from one state to the next by examining and choosing from among the alternative URLs in the response document.

Get Detailed Part Data

The web service makes available a URL to each part resource. Example, here's how a client requests part 00345:

 

http://www.parts-depot.com/parts/00345
Here's the document that the client receives:

 

<?xml version="1.0"?>
<p:Part xmlns:p="http://www.parts-depot.com"   
        xmlns:xlink="http://www.w3.org/1999/xlink">
      <Part-ID>00345</Part-ID>
      <Name>Widget-A</Name>
      <Description>This part is used within the frap assembly</Description>
      <Specification xlink:href="http://www.parts-depot.com/parts/00345/specification"/>
      <UnitCost currency="USD">0.10</UnitCost>
      <Quantity>10</Quantity>
</p:Part>
Again observe how this data is linked to still more data - the specification for this part may be found by traversing the hyperlink. Each response document allows the client to drill down to get more detailed information.

Submit PO

The web service makes available a URL to submit a PO. The client creates a PO instance document which conforms to the PO schema that Parts Depot has designed (and publicized in a WSDL document). The client submits PO.xml as the payload of an HTTP POST.

 

The PO service responds to the HTTP POST with a URL to the submitted PO. Thus, the client can retrieve the PO any time thereafter (to update/edit it). The PO has become a piece of information which is shared between the client and the server. The shared information (PO) is given an address (URL) by the server and is exposed as a Web service.

Logical URLs versus Physical URLs

A resource is a conceptual entity. A representation is a concrete manifestation of the resource. This URL:
http://www.parts-depot.com/parts/00345
is a logical URL, not a physical URL. Thus, there doesn't need to be, for example, a static HTML page for each part. In fact, if there were a million parts then a million static HTML pages would not be a very attractive design.

 

[Implementation detail: Parts Depot could implement the service that gets detailed data about a particular part by employing a Java Servlet which parses the string after the host name, uses the part number to query the parts database, formulate the query results as XML, and then return the XML as the payload of the HTTP response.]

 

As a matter of style URLs should not reveal the implementation technique used. You need to be free to change your implementation without impacting clients or having misleading URLs.

REST Web Services Characteristics

Here are the characteristics of REST:
  • Client-Server: a pull-based interaction style: consuming components pull representations.
  • Stateless: each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored context on the server.
  • Cache: to improve network efficiency responses must be capable of being labeled as cacheable or non-cacheable.
  • Uniform interface: all resources are accessed with a generic interface (e.g., HTTP GET, POST, PUT, DELETE).
  • Named resources - the system is comprised of resources which are named using a URL.
  • Interconnected resource representations - the representations of the resources are interconnected using URLs, thereby enabling a client to progress from one state to another.
  • Layered components - intermediaries, such as proxy servers, cache servers, gateways, etc, can be inserted between clients and resources to support performance, security, etc.

Principles of REST Web Service Design

1. The key to creating Web Services in a REST network (i.e., the Web) is to identify all of the conceptual entities that you wish to expose as services. Above we saw some examples of resources: parts list, detailed part data, purchase order.

2. Create a URL to each resource. The resources should be nouns, not verbs. For example, do not use this:

 

http://www.parts-depot.com/parts/getPart?id=00345
Note the verb, getPart. Instead, use a noun:

 

http://www.parts-depot.com/parts/00345
3. Categorize your resources according to whether clients can just receive a representation of the resource, or whether clients can modify (add to) the resource. For the former, make those resources accessible using an HTTP GET. For the later, make those resources accessible using HTTP POST, PUT, and/or DELETE.

 

4. All resources accessible via HTTP GET should be side-effect free. That is, the resource should just return a representation of the resource. Invoking the resource should not result in modifying the resource.

 

5. No man/woman is an island. Likewise, no representation should be an island. In other words, put hyperlinks within resource representations to enable clients to drill down for more information, and/or to obtain related information.

 

6. Design to reveal data gradually. Don't reveal everything in a single response document. Provide hyperlinks to obtain more details.

 

7. Specify the format of response data using a schema (DTD, W3C Schema, RelaxNG, or Schematron). For those services that require a POST or PUT to it, also provide a schema to specify the format of the response.

 

8. Describe how your services are to be invoked using either a WSDL document, or simply an HTML document.

Summary

This article described REST as an architectural style. In fact, it's the architectural style of the Web. REST describes what makes the Web work well. Adhering to the REST principles will make your services work well in the context of the Web.

 

In a future article I will write about the evolution of the Web using the REST principles.

Acknowledgement

Thanks to Robert Leftwich and Philip Eskelin for their very helpful comments in creating this document.

References

[1] http://www.ebuilt.com/fielding/pubs/dissertation/top.htm

绝缘检测原理和绝缘电阻计算方法 绝缘检测的目的就是计算绝缘电阻,当绝缘电阻低于某个阈值,则很可能会造成电池短路、漏电,威胁人员安全 阅读详情

相关推荐

零基础玩转IndexTTS2:5分钟搭建个人语音克隆工具(支持B站同款情感语音)

本文详细介绍了如何零基础使用IndexTTS2快速搭建个人语音克隆工具,支持B站同款情感语音。IndexTTS2作为自回归零样本TTS系统,突破传统技术限制,实现精准时长控制和丰富情感表达。通过HuggingFace在线演示,用户可轻松克隆音色并调节情感参数,适用于自媒体配音、有声书朗读等场景。

purple的博客 924

什么是REST API以及REST API的使用

API的分类 REST API(restful) REST是Representational State Transfer(表现层状态转移)的缩写,它是由罗伊·菲尔丁(Roy Fielding)提出的 非 REST API(restless) REST API 发送请求进行 CRUD 哪个操作由请求方式来决定 同一个请求路径可以进行多个操作 请求方式会用到 GET/POST/PUT/DELETE 非 REST API 请求方式不决定请求的 CRUD 操作 一个请求路径只对应一个操作 一般只

youhebuke225的博客 1万+

Java 开发打飞机小游戏(附完整源码)

上图 写在前面 技术源于分享,所以今天抽空把自己之前用java做过的小游戏整理贴出来给大家参考学习。java确实不适合写桌面应用,这里只是通过这个游戏让大家理解oop面向对象编程的过程,纯属娱乐。代码写的很简单,也很容易理解,并且注释写的很清楚了,还有问题,自己私下去补课学习。 完整代码 敌飞机 import java.util.Random; 敌飞机: 是飞行物,也是敌人 public class Airplane extends FlyingObject implements Enemy {

一只独孤的程序猿 1万+

什么是REST?

这里是修真院前端小课堂,本篇分析的主题是 【什么是REST?】 每篇分享文从 【背景介绍】【知识剖析】【常见问题】【解决方案】【编码实战】【扩展思考】【更多讨论】【参考文献】 八个方面深度解析前端知识/技能,本篇分享的是: 【什么是REST?】 1.背景介绍 要解释什么是REST,你应该先了解什么是API(Application Programming Interface,...

IT修真院:初学者转行到互联网的聚集地 7416

手把手教你配置UEFI Secure Boot:从密钥生成到系统验证(附避坑指南)

本文详细介绍了如何配置UEFI Secure Boot,从密钥生成到系统验证的全过程,包括PK、KEK等关键密钥的生成方法,以及常见问题的解决方案。通过实战案例和避坑指南,帮助用户有效提升系统启动安全性,防止恶意软件植入。

weixin_30776273的博客 348

逆变器并联--下垂控制引入虚拟阻抗

说明传统下垂控制的缺点、分析虚拟阻抗的原理和实现方法

weixin_58670090的博客 1万+

rest api是什么_什么是REST API?

rest api是什么 在此博客中,我将讨论REST API,什么是Rest API,什么是REST API以及如何使用。 因此,希望您阅读此博客后能对REST API有所了解。 Roy Fielding定义了REST。 在2000年的博士学位论文中,他介绍了REST原理。 什么是REST? REST代表代表性状态转移 。 我们也可以说REST是API的体系结构样式或设计模式。 ...

编程故事的地方 7827

对数周期天线hfss建模_Ansoft HFSS 在设计对数周期天线时的仿真方法-HFSS教程

AnsoftHFSS在设计对数周期天线时的仿真方法文章来源: ANSYS 2011中国用户大会优秀论文 录入: mweda.com 点击数:【摘要】 本文通过 ANSOFT HFSS 设计了一个对数周期天线,在仿真分析时,发现随着求解频率的不同,天线的求解结果差别较大,求解误差较大。通过在 HFSS 中尝试不同的求解设置方法, 最终通过将天线模型剖分网格最大长度限定在 1/50λ的...

weixin_42186728的博客 2105

【REST】REST是什么

REST 自从Roy Fielding博士在2000年他的博士论文中提出REST(Representational State Transfer)风格的软件架构模式后,REST就基本上迅速取代了复杂而笨重的SOAP,成为Web API的标准了。 什么是Web API呢? 如果我们想要获取某个电商网站的某个商品,输入http://localhost:3000/products/123,就可以看到id...

寒泉 6万+

从零开始:使用Verilog在FPGA上实现8051微控制器的完整指南

8051微控制器是一种8位微控制器,由Intel在1980年代初推出。它包括一个CPU、一些RAM和ROM、I/O端口、定时器和串行通信接口。由于其简单的架构和强大的功能,8051已经成为了嵌入式系统设计的首选。FPGA是一种集成电路,设计师可以按照自己的需求进行编程。与传统的ASIC(应用特定集成电路)相比,FPGA提供了更高的灵活性,允许在硬件级别进行快速原型设计和迭代。这里,我们定义了一些基本的输入/输出端口,如时钟clk、复位reset、数据输入/输出和地址输入/输出。

qq_38334677的博客 1337

YOLO11多个点组合创新:GC10-DET缺陷检测 | DCNv4结合SPPF+11Detect创新性结合

DCNv4结合SPPF+11Detect创新性结合,原始mAP50为0.633 提升至0.651

①答疑群聊服务;②YOLO大模型知识问答系统;③计算机视觉论文生成智能体; 1294

REST 详解

REST 详解

T_Y_F_的博客 3834

​ISP算法及架构分析介绍

ISP算法及架构分析介绍ISP即Image Signal Processor,是一种图像处理架构,不是我们用的下载器。ISP其实算是图像处理的一个特例,一般应用于前端设备(相对于SENSOR),从结果上看就是将RAW数据转换成压缩后的RGB(一般)数据,供后续CPU使用(识别、压缩等)。市面上很少有直接介绍ISP的书籍或者资料,今天我们主要是聊一聊ISP算法的架构,这样大...

OpenFPGA的博客 5410

REST与SOAP之比较 ——REST篇

 我有这样一个推断,在计算机世界中,但凡那些让开发人员记住的重要概念,都有一个很酷的名称首字母缩写,否则的话,开发人员很快就会将其抛之脑后。比如Ajax、SOAP以及REST就证明了这一点。REST能够在计算机领域被广泛采用,它走的道路是不同寻常的。这个术语是由Roy Fielding创造的。Fielding毕业于Irvine市加利福尼亚大学,在他的博士学位论文中第一次提出了REST这个概念。

海中天 5766

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

使用IDEA自带的 Editor REST Client 来测试 REST API

Overview 开发 REST API 的时候,必然少不了测试。测试 API 可以采用以下方式: Chrome 请求 不方便构造 POST 请求 Postman 等 Post 工具ß 需要下载工具,好处是可以记录请求,批量测试 Swagger 项目集成,方便操作,同时也提供给前端使用 Editor REST Client IDEA自带,操作方便,不需要要切换到浏览器页面...

MyHerux的博客 8337

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

rest api 示例2_REST API教程– REST Client,REST Service和API调用通过代码示例进行了解释

rest api 示例2Ever wondered how login/signup on a website works on the back-end? Or how when you search for "cute kitties" on YouTube, you get a bunch of results and are able to stream off of a remote m...

cumi7754的博客 1089

struts2 rest插件

REST 简介 REST 是英文 Representational State Transfer 的缩写,这个术语由 Roy Thomas Fielding 博士在他的论文《Architectural Styles and the Design of Network-based Software Architectures》中提出。从这篇论文的标题可以看出:REST 是一种基于网络的软件架构

wxwlife2006的专栏 4550

REST API简介

REST API简介

网络资源是无限的 1616

当REST遇上Java

当REST遇上Java今天我们来一起学习和了解rest的相关知识,做后台程序的或多说少都听说过甚至使用过rest技术,但很多同学可能都没有真正了解什么是rest,这里我们就一起来学习一下。rest的前世今生一、起源 REST这个词,是Roy Thomas Fielding在他2000年的博士论文中提出的。 Fielding是一个非常重要的人,他是HTTP协议(1.0版和1.1版)的主要设计者、A

googlevsbing的专栏 4563

{定义介绍}什么是REST

REST架构风格是全新的针对Web应用的开发风格,是当今世界最成功的互联网超媒体分布式系统架构,它使得人们真正理解了Http协议本来面貌。随着 REST架构成为主流技术,一种全新的互联网网络应用开发的思维方式开始流行。      REST是什么     REST是英文Representational State Transfer的缩写,中文翻译为“表述性状态转移”,他是由Roy Th

享受心情平静 1万+

REST协议

 REST是什么 REST是英文Representational State Transfer的缩写,中文翻译为“表述性状态转移”,他是由Roy Thomas Fielding博士在他的论文 《Architectural Styles and the Design of Network-based Software Architectures》中提出的一个术语。REST本身只是为分布

zg68的专栏 7091

到底什么是REST?怎么用通俗的语言解释REST以及RESTful?

最近在学习Retrofit的时候,看到Square官方对Retrofit的描述: “A type-safe REST client for Android and Java“即:Retrofit是为Android和Java平台的应用提供的一个类型安全的REST客户端。那么什么是REST呢?REST – Representational State Transfer 直接翻译:表现层状态转移。这个中文

dxcn2015的博客 8022

http的rest服务简介_REST概念简介

http的rest服务简介 介绍 这篇文章旨在揭开REST(代表性状态转移)Web设计概念的神秘面纱。 REST基于客户端服务器模型。 REST是一组原则,例如描述了如何使用标准来开发Web应用程序。 其主要目的是预期常见的实现问题并组织逻辑客户端和服务器之间的关系。 您可以将其称为一组最佳实践! 在实践中,REST提供有关如何实现Web应用程序接口到Web的指南。 通常,有人说Web...

danpu0978的博客 1590

什么是REST风格

什么是REST风格 REST(Representational State Transfer表述性状态转移)是一种针对网络应用的设计和开发方式,可以降低开发的复杂性,提高系统的可伸缩性。REST提出了一些设计概念和准则:   1.网络上的所有事物都被抽象为资源(resource);    2.每个资源对应一个唯一的资源标识(resource identifier); 

3544

什么是REST

REST是表述性状态传输(REpresentationalStateTransfer)的缩写。它是分布式超媒体系统的体系结构样式,由罗伊·菲尔丁(Roy Fielding)于2000年在他的著名论文中首次提出。 像任何其他体系结构样式一样,REST还具有自己的6个指导约束,如果需要将接口称为RESTful,则必须满足这些约束。这些原则在下面列出。 REST指导原则 客户端-服务器–通过将用户界面问题与数据存储问题分开,我们提高了用户界面在多个平台上的可移植性,并通过简化服务器组件来提高可伸缩性。 ..

allway2的博客 1306

REST API

REST(Representational State Transfer,表现层状态转移)是一种软件架构风格,用于设计网络应用程序接口(API)。REST API 是遵循 REST 原则的 API,它使用 HTTP 协议进行通信,通常以 JSON 或 XML 格式传输数据。REST 不是一种协议或标准,而是一组设计原则,使 API 更加简洁、可扩展和易于理解。REST API 是一种灵活、可扩展的接口设计风格,通过使用标准 HTTP 方法和状态码,使不同系统之间的通信变得简单。

2502_92141759的博客 1085

到底什么样的 REST 才是最佳 REST?

说起 REST API,小伙伴们多多少少都有听说过,但是如果让你详细介绍一下什么是 REST,估计会有很多人讲不出来,或者只讲出来其中一部分。今天松哥就来和大家一起来聊一聊到底什么是 REST,顺便再来看下 Spring HATEOAS 的用法。

江南一点雨的专栏 1124
上一篇: session and cookie
下一篇: SOA学习笔记(一)----SOA基本概念
patrick002
博客等级 码龄19年 6粉丝 18原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值