<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6432484966567158349</id><updated>2012-02-10T03:44:37.951-08:00</updated><title type='text'>Learn REST: A Tutorial</title><subtitle type='html'>A fast-training course for &lt;b&gt;REST&lt;/b&gt; - &lt;i&gt;Re&lt;/i&gt;presentational &lt;i&gt;S&lt;/i&gt;tate &lt;i&gt;T&lt;/i&gt;ransfer, a new approach to systems architecture and a lightweight alternative to web services</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rest.elkstein.org/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-7197089526757106233</id><published>2008-02-12T23:00:00.000-08:00</published><updated>2008-02-12T23:45:55.319-08:00</updated><title type='text'>1. What is REST?</title><summary type='text'>REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a stateless, client-server, cacheable communications protocol -- and in virtually all cases, the HTTP protocol is used.REST is an architecture style for designing networked applications. The idea is that, rather than using complex mechanisms such as CORBA, RPC or SOAP to connect between machines, </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/7197089526757106233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=7197089526757106233' title='26 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/7197089526757106233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/7197089526757106233'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/what-is-rest.html' title='1. What is REST?'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>26</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-4660893850404656480</id><published>2008-02-12T22:00:00.000-08:00</published><updated>2008-02-14T04:15:11.568-08:00</updated><title type='text'>2. REST as Lightweight Web Services</title><summary type='text'>As a programming approach, REST is a lightweight alternative to Web Services and RPC.Much like Web Services, a REST service is:Platform-independent (you don't care if the server is Unix, the client is a Mac, or anything else),Language-independent (C# can talk to Java, etc.),Standards-based (runs on top of HTTP), andCan easily be used in the presence of firewalls.Like Web Services, REST offers no </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/4660893850404656480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=4660893850404656480' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/4660893850404656480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/4660893850404656480'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/rest-as-lightweight-web-services.html' title='2. REST as Lightweight Web Services'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-1127899704173401350</id><published>2008-02-12T21:00:00.000-08:00</published><updated>2010-12-11T06:15:46.011-08:00</updated><title type='text'>3. How Simple is REST?</title><summary type='text'>Let's take a simple web service as an example: querying a phonebook application for the details of a given user. All we have is the user's ID.Using Web Services and SOAP, the request would look something like this:&lt;?xml version="1.0"?&gt;
&lt;soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"&gt;
 &lt;soap:body pb="http://</summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/1127899704173401350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=1127899704173401350' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/1127899704173401350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/1127899704173401350'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/how-simple-is-rest.html' title='3. How Simple is REST?'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-3673658851645058486</id><published>2008-02-12T20:00:00.000-08:00</published><updated>2008-02-15T06:54:09.670-08:00</updated><title type='text'>4. More Complex REST Requests</title><summary type='text'>The previous section included a simple example for a REST request -- with a single parameter.REST can easily handle more complex requests, including multiple parameters. In most cases, you'll just use HTTP GET parameters in the URL.For example:http://www.acme.com/phonebook/UserDetails?firstName=John&amp;lastName=DoeIf you need to pass long parameters, or binary ones, you'd normally use HTTP POST </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/3673658851645058486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=3673658851645058486' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/3673658851645058486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/3673658851645058486'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/more-complex-rest-requests.html' title='4. More Complex REST Requests'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-7769993720569953596</id><published>2008-02-12T19:30:00.000-08:00</published><updated>2011-09-23T12:57:29.625-07:00</updated><title type='text'>5. REST Server Responses</title><summary type='text'>A server response in REST is often an XML file; for example,&lt;parts-list&gt;
 &lt;part id="3322"&gt;
  &lt;name&gt;ACME Boomerang&lt;/name&gt;
  &lt;desc&gt;
   Used by Coyote in &lt;i&gt;Zoom at the Top&lt;/i&gt;, 1962
  &lt;/desc&gt;
  &lt;price currency="usd" quantity="1"&gt;17.32&lt;/price&gt;
  &lt;uri&gt;http://www.acme.com/parts/3322&lt;/uri&gt;
 &lt;/part&gt;
 &lt;part id="783"&gt;
  &lt;name&gt;ACME Dehydrated Boulders&lt;/name&gt;
  &lt;desc&gt;
   Used by Coyote in &lt;i&gt;Scrambled Aches</summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/7769993720569953596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=7769993720569953596' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/7769993720569953596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/7769993720569953596'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/rest-server-responses.html' title='5. REST Server Responses'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-2877263407759349042</id><published>2008-02-12T19:00:00.000-08:00</published><updated>2011-09-23T13:34:45.901-07:00</updated><title type='text'>6. Real REST Examples</title><summary type='text'>Here's a very partial list of service providers that use a REST API. Note that some of them also support a WSDL (Web Services) API, in addition, so you can pick which to use; but in most cases, when both alternatives are available, REST calls are easier to create, the results are easier to parse and use, and it's also less resource-heavy on your system.So without further ado, some REST services:</summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/2877263407759349042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=2877263407759349042' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/2877263407759349042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/2877263407759349042'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/real-rest-examples.html' title='6. Real REST Examples'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-426453086212387048</id><published>2008-02-12T18:30:00.000-08:00</published><updated>2008-02-15T07:16:23.712-08:00</updated><title type='text'>7. AJAX and REST</title><summary type='text'>AJAX is a popular web development technique that makes web pages interactive using JavaScript.In AJAX, requests are sent to the server using XMLHttpRequest objects. The response is used by the JavaScript code to dynamically change the current page.In many ways, AJAX applications follow the REST design principles. Each XMLHttpRequest can be viewed as a REST service request, sent using GET. And the</summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/426453086212387048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=426453086212387048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/426453086212387048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/426453086212387048'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/ajax-and-rest.html' title='7. AJAX and REST'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-8057145453226261750</id><published>2008-02-12T18:00:00.000-08:00</published><updated>2012-02-07T23:33:29.547-08:00</updated><title type='text'>8. REST Architecture Components</title><summary type='text'>Key components of a REST architecture:Resources, which are identified by logical URLs. Both state and functionality are represented using resources.The logical URLs imply that the resources are universally addressable by other parts of the system.Resources are the key element of a true RESTful design, as opposed to "methods" or "services" used in RPC and SOAP Web Services, respectively. You do </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/8057145453226261750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=8057145453226261750' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/8057145453226261750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/8057145453226261750'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/rest-architecture-components.html' title='8. REST Architecture Components'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-9012084198722981760</id><published>2008-02-12T17:00:00.000-08:00</published><updated>2008-02-13T23:46:57.285-08:00</updated><title type='text'>9. REST Design Guidelines</title><summary type='text'>Some soft guidelines for designing a REST architecture:Do not use "physical" URLs. A physical URL points at something physical -- e.g., an XML file: "http://www.acme.com/inventory/product003.xml". A logical URL does not imply a physical file: "http://www.acme.com/inventory/product/003".Sure, even with the .xml extension, the content could be dynamically generated. But it should be "humanly </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/9012084198722981760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=9012084198722981760' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/9012084198722981760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/9012084198722981760'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/rest-design-guidelines.html' title='9. REST Design Guidelines'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-5738513359339784109</id><published>2008-02-12T16:00:00.000-08:00</published><updated>2008-11-13T23:48:04.443-08:00</updated><title type='text'>10. ROA vs. SOA, REST vs. SOAP</title><summary type='text'>ROA (REST Oriented Architecture) is just a fancy name for a SOA (Service Based Architecture) using REST services.The main advantage of SOAP-based SOA over ROA is the more mature tool support; however, this could change over time. Another SOA advantages include the type-safety of XML requests (for responses, ROA can also use XML if the developers desire it).The main advantage of ROA is ease of </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/5738513359339784109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=5738513359339784109' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/5738513359339784109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/5738513359339784109'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/roa-vs-soa-rest-vs-soap.html' title='10. ROA vs. SOA, REST vs. SOAP'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-5615184770241228601</id><published>2008-02-12T15:00:00.000-08:00</published><updated>2008-02-15T06:55:31.582-08:00</updated><title type='text'>11. Documenting REST Services: WSDL and WADL</title><summary type='text'>WSDL, a W3C recommendation, is the Web Services Description Language. It is commonly used to spell out in detail the services offered by a SOAP server. While WSDL is flexible in service binding options (for example, services can be offered via SMTP mail servers), it did not originally support HTTP operations other than GET and POST. Since REST services often use other HTTP verbs, such as PUT and </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/5615184770241228601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=5615184770241228601' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/5615184770241228601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/5615184770241228601'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/documenting-rest-services-wsdl-and-wadl.html' title='11. Documenting REST Services: WSDL and WADL'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-2779621445972618014</id><published>2008-02-12T14:00:00.000-08:00</published><updated>2008-02-17T12:39:40.799-08:00</updated><title type='text'>12. REST Examples in Different Languages</title><summary type='text'>The following sections provide brief examples for accessing REST services in different programming languages. More than anything else, they present mechanisms for sending HTTP GET and/or POST requests in each language; the rest of using REST is simply a matter of architectural design.You might wish to skip directly to your language of choice (the list is alphabetical): C#</summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/2779621445972618014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=2779621445972618014' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/2779621445972618014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/2779621445972618014'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/rest-examples-in-different-languages.html' title='12. REST Examples in Different Languages'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-9089239201328242392</id><published>2008-02-12T13:00:00.001-08:00</published><updated>2010-07-09T05:37:19.421-07:00</updated><title type='text'>12.1. Using REST in C#</title><summary type='text'>Issuing HTTP GET RequestsThe key classes here are HttpWebRequest and HttpWebResponse from System.Net.
The following method issues a request and returns the entire response as one long string:
static string HttpGet(string url) {
  HttpWebRequest req = WebRequest.Create(url)
                       as HttpWebRequest;
  string result = null;
  using (HttpWebResponse resp = req.GetResponse()
</summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/9089239201328242392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=9089239201328242392' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/9089239201328242392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/9089239201328242392'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/using-rest-in-c-sharp.html' title='12.1. Using REST in C#'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-6777164773134858999</id><published>2008-02-12T12:00:00.000-08:00</published><updated>2008-02-15T12:04:40.174-08:00</updated><title type='text'>12.2. Using REST in Java</title><summary type='text'>Issuing HTTP GET RequestsThe key class here is HttpURLConnection, obtained by invoking openConnection on a URL object. Sadly, openConnection method's signature specifies that it returns the superclass type, URLConnection, and we have to downcast the result.The following method issues a request and returns the entire response as one long string:
public static String httpGet(String urlStr) throws </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/6777164773134858999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=6777164773134858999' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/6777164773134858999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/6777164773134858999'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/using-rest-in-java.html' title='12.2. Using REST in Java'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-431950555259501240</id><published>2008-02-12T11:00:00.001-08:00</published><updated>2008-02-15T11:26:36.688-08:00</updated><title type='text'>12.3. Using REST in JavaScript</title><summary type='text'>The page discusses sending REST requests from client-side (in-browser) JavaScript. If you're using server-side JavaScript, see your server vendor's documentation for creating HTTP requests.If you have developed AJAX applications, all this will seem trivial to you: after all, every AJAX request is an HTTP request, and in many ways, AJAX applications are RESTful.Creating XMLHttpRequest </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/431950555259501240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=431950555259501240' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/431950555259501240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/431950555259501240'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/using-rest-in-javascript.html' title='12.3. Using REST in JavaScript'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-4297329887117951676</id><published>2008-02-12T10:00:00.001-08:00</published><updated>2008-02-16T02:38:23.187-08:00</updated><title type='text'>12.4. Using REST in Perl</title><summary type='text'>To work with HTTP in Perl, we will use LWP -- the Library for WWW in Perl.Issuing GET RequestsGET requests are pretty trivial with LWP, especially if you don't care much about setting headers in the request or reading headers in the response:use LWP::Simple;

my $url = 'http://www.acme.com/products/3322';
          # ACME boomerang
my $response = get $url;
die 'Error getting $url' unless defined </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/4297329887117951676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=4297329887117951676' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/4297329887117951676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/4297329887117951676'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/using-rest-in-perl.html' title='12.4. Using REST in Perl'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-5675731006062015398</id><published>2008-02-12T09:00:00.000-08:00</published><updated>2008-02-16T03:25:08.485-08:00</updated><title type='text'>12.5. Using REST in PHP</title><summary type='text'>Issuing GET RequestsModern versions of PHP make it trivial to GET web pages: any file-access function (even include!) works seamlessly with URLs, too. Thus, you can use fopen, file_get_contents, and any other file-reading function to issue GET requests. For example:$url = "http://www.acme.com/products/3322";
$response = file_get_contents($url);
echo $response;Any parameters passed to GET requests</summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/5675731006062015398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=5675731006062015398' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/5675731006062015398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/5675731006062015398'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/using-rest-in-php.html' title='12.5. Using REST in PHP'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-6286634077478995404</id><published>2008-02-12T08:00:00.000-08:00</published><updated>2008-02-16T05:18:43.223-08:00</updated><title type='text'>12.6. Using REST in Python</title><summary type='text'>Issuing GET RequestsThe Python module urllib2 makes reading URLs trivial:import urllib2

url = 'http://www.acme.com/products/3322'
response = urllib2.urlopen(url).read()Errors are reported as exceptions (urllib2.HTTPError or urllib2.URLError).Issuing POST RequestsA POST request is just as easy, simply passing (encoded) request data as an extra parameter to urlopen, thus:import urllib
import </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/6286634077478995404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=6286634077478995404' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/6286634077478995404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/6286634077478995404'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/using-rest-in-python.html' title='12.6. Using REST in Python'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-294525614015388726</id><published>2008-02-12T07:00:00.000-08:00</published><updated>2011-09-23T13:08:34.491-07:00</updated><title type='text'>12.7. Using REST in Ruby</title><summary type='text'>As with Python, sending HTTP requests in Ruby is extremely easy.Issuing GET RequestsWe use the class Net::HTTP to do all the magic:require 'net/http'

url = 'http://www.acme.com/products/3322' # ACME boomerang
resp = Net::HTTP.get_response(URI.parse(url))

resp_text = resp.bodyThe response field code contains the HTTP response code. To make things simpler, the result object's very class indicates</summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/294525614015388726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=294525614015388726' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/294525614015388726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/294525614015388726'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/using-rest-in-ruby.html' title='12.7. Using REST in Ruby'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-2445179923734883277</id><published>2008-02-12T02:00:00.000-08:00</published><updated>2008-02-17T12:47:38.212-08:00</updated><title type='text'>13. For More About REST</title><summary type='text'>Purely academic: the notion of REST was created in the PhD dissertation of Roy T. Fielding.Mostly academic: the Wikipedia article about REST.JSR 311 is the Java Specification Request for "JAX-RS: The Java API for RESTful Web Services".At the time of writing (Feb '08), still in draft review stages.Check out this presentation for a good overview of the JSR.Restlet is suggesting an easier way to </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/2445179923734883277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=2445179923734883277' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/2445179923734883277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/2445179923734883277'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/02/for-more-about-rest.html' title='13. For More About REST'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-287399055878560313</id><published>2008-01-12T23:00:00.000-08:00</published><updated>2010-08-23T10:55:09.902-07:00</updated><title type='text'>14. Questions and Answers</title><summary type='text'>In this section, I'll be adding common questions about REST, or real issues I've encountered while developing RESTful services.

If you have a question, feel free to post it as a comment on this page, or on any other relevant page in this tutorial.

Questions posted so far:


How do I perform atomic operations using REST?
How do I delete items using a REST API?
How do I handle authentication in </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/287399055878560313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=287399055878560313' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/287399055878560313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/287399055878560313'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/01/questions-and-answers.html' title='14. Questions and Answers'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-7673561977327543590</id><published>2008-01-12T22:50:00.000-08:00</published><updated>2009-02-06T23:39:27.329-08:00</updated><title type='text'>14.1. How do I perform atomic operations using REST?</title><summary type='text'>QUESTION: How do I perform atomic operations using REST? If I would like to execute multiple operations, but have them all appear as an single, atomic transaction, REST seems inappropriate.ANSWER: REST faces the exact same problem as SOAP-based web services with regards to atomic transactions. There is no stateful connection, and every operation is immediately committed; performing a series of </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/7673561977327543590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=7673561977327543590' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/7673561977327543590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/7673561977327543590'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/01/atomic-or-batch-operations-using-rest.html' title='14.1. How do I perform atomic operations using REST?'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-6013652327585755553</id><published>2008-01-12T22:40:00.000-08:00</published><updated>2009-02-07T00:13:06.321-08:00</updated><title type='text'>14.2. How do I delete items using a REST API?</title><summary type='text'>QUESTION: How do I provide a REST API for deleting resources in the system (e.g., a record from a database)? I was told that using a simple GET API, or even POST, is inappropriate, but I don't know why.

ANSWER: There's a well-known story about a company that had its entire database wiped out by Google. Why? Because they had a "delete" link on every web page, and Googlebot crawled all links it </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/6013652327585755553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=6013652327585755553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/6013652327585755553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/6013652327585755553'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2009/02/deleting-data-using-rest.html' title='14.2. How do I delete items using a REST API?'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6432484966567158349.post-4993838097704473129</id><published>2008-01-12T22:30:00.001-08:00</published><updated>2010-08-23T10:53:23.837-07:00</updated><title type='text'>14.3. How do I handle authentication in REST?</title><summary type='text'>QUESTION: Most services require user to login before exploring further. If cookies are not recommended in REST, does it mean I have to go thru authentication on every single request (e.g., HTTP AUTH)?

ANSWER: There are two basic approaches here. The first is, use HTTP AUTH. The (human) user will be prompted for the credential just once (or they will be loaded from file, depending on the system </summary><link rel='replies' type='application/atom+xml' href='http://rest.elkstein.org/feeds/4993838097704473129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6432484966567158349&amp;postID=4993838097704473129' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/4993838097704473129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6432484966567158349/posts/default/4993838097704473129'/><link rel='alternate' type='text/html' href='http://rest.elkstein.org/2008/01/how-do-i-handle-authentication-in-rest.html' title='14.3. How do I handle authentication in REST?'/><author><name>Dr. M. Elkstein</name><uri>http://www.blogger.com/profile/01086047572579338522</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry></feed>
