Building a restful web Service

Source: Internet
Author: User
Tags abstract http request representational state transfer resource web services

1. What is rest?

REST was a term put forward by Roy Fielding in his paper the architectural Styles and the design of network-based Software architectures.

REST is an abbreviation of the English representational state Transfer, which has Chinese translations for "representational status Transfer" (Reference: Representational states Transfer (REST) and data distribution in the SIP/IMS network 》 )。

Rest can be summed up as follows:

1.1 First rest is just a style, not a standard

You won't be the putting out a REST specification. You are not, IBM or Microsoft or Sun selling a REST developer ' s toolkit. Why? Because REST is just a architectural style. Can ' t bottle up that style. You can only understand it, and design your WEB services in that style.

-Roger L. Costello "Building Web Services" REST Way.

1.2 Rest is resource-centric

In rest, the web is considered to consist of a series of abstract resources (abstract Resource) that have different concrete representations (representational state). For example, defining a resource as photo, meaning a photograph, can be a picture or an. xml file that contains some elements that describe the photo. or an HTML file. And these concrete manifestations can be distributed in different physical locations.

The purpose of 1.3 rest is to decide how to make a well-defined web program move forward

A program can make a program run further by selecting a hyperlink on a Web page (which represents a resource) that enables another Web page (representational state of the abstract resource) to be returned (transfer) to the user.

1.4 Rest make full use of, or extreme reliance on, HTTP protocols

It locates resources through logical URIs

In the definition of REST, a WEB application always renders (or exposes) a resource to the outside world using a fixed URI.

It must be noted here

1, a URI corresponds to a resource.

2, the URI here is a logical URI,

A logical Uri:http://www.example.com/photo/logo

A physical uri:http://www.example.com/photo/logo.html

Data that distinguishes a client from the form in which it is intended to obtain resources by identifying the HTTP Request Header information.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.