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
  • PrintPrint
Share this Page URL
Help

Chapter 11. Remote access > Negotiating the representation

11.2. Negotiating the representation

Imagine a traveler wandering through a market in a remote part of the world. He sees something he wants to buy, but in order to do that he needs to communicate with the trader. The first step involves agreeing on a language that both sides understand—even if it’s just improvised sign language. This is analogous to how a client and server must agree on a format for data interchange in REST.

Grails provides a facility called “content negotiation” that manages different formats and handles the negotiation with the client. The client can specify its preferred content format a variety of ways, and, on the server side, Grails makes it easy to render different content based on that format. Figure 11.3 illustrates how this works at a high level.


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint