Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 1. Using the Uniform Interface

Chapter 1. Using the Uniform Interface

HTTP is an application-level protocol that defines operations for transferring representations between clients and servers. In this protocol, methods such as GET, POST, PUT, and DELETE are operations on resources. This protocol eliminates the need for you to invent application-specific operations such as createOrder, getStatus, updateStatus, etc. How much you can benefit from the HTTP infrastructure largely depends on how well you can use HTTP as an application-level protocol. However, a number of techniques including SOAP and some Ajax web frameworks use HTTP as a protocol to transport messages. Such usage makes poor use of HTTP-level infrastructure. This chapter presents the following recipes to highlight various aspects of using HTTP as an application protocol:


Section 1.1

Visibility is one of the key characteristics of HTTP. Use this recipe to learn how to maintain visibility.


Section 1.2

There are cases when you may need to forgo visibility to meet application needs. Use this recipe to find some scenarios.


Section 1.3

Use this recipe to learn the best way to manage state.


Section 1.4

Maintaining safety and idempotency helps servers guarantee repeatability for requests. Use this recipe when implementing servers.


Section 1.5

Follow this recipe to implement clients for safety and idempotency principles.


Section 1.6

Use this recipe to learn when to use GET.


Section 1.7

Use this recipe to learn when to use POST.


Section 1.8

Use this recipe to learn how to create new resources using the POST method.


Section 1.9

You can use either POST or PUT to create new resources. This recipe will discuss when using PUT is better.


Section 1.10

Use this recipe to learn how to use the POST method for asynchronous tasks.


Section 1.11

Use this recipe to learn how to use the DELETE method for asynchronous deletion of resources.


Section 1.12

Use this recipe to learn why custom HTTP methods are not recommended.


Section 1.13

Use this recipe to learn when and how to use custom HTTP headers.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial