Cover by Savas Parastatidis, Jim Webber, Ian Robinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

URI Tunneling

When we order coffee from Restbucks, we first select the drinks we’d like, then we customize those drinks in terms of size, type of milk (if any), and other specialties such as flavorings. Once we’ve decided, we can convey our order to the cashier who handles all incoming orders. Of course, we have numerous options for how to convey our order to a cashier, and on the Web, URI tunneling is the simplest.

URI tunneling uses URIs as a means of transferring information across system boundaries by encoding the information within the URI itself.[23] This can be a useful technique, because URIs are well understood by web servers (of course!) and web client software. Since web servers can host code, this allows us to trigger program execution by sending a simple HTTP GET or POST request to a web server, and gives us the ability to parameterize the execution of that code using the content of the URI. Whether we choose GET or POST depends on our intentions: retrieving information should be tunneled through GET, while changing state really ought to use POST.

On the Web, we use GET in situations where we want to retrieve a resource’s state representation, rather than deliberately modify that state. When used properly, GET is both safe and idempotent.

By safe, we mean a GET request generates no server-side side effects for which the client can be held responsible. There may still be side effects, but any that do occur are the sole responsibility of the service. For example, many services ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required