Datasheet
Schwartz c01.tex V3 - 12/26/2008 11:38am Page 22
Chapter 1: Social Computing
Table 1-1
HTTP Method CRUD
PUT Create
GET Read
POST Update
DELETE Delete
The best way to recognize when a system has used REST as a way to make calls to the underlying data is
to see if a resource-based call can be made, such as the following:
http://www.devcow.com/eventserver/usergrouops/
http://www.devcow.com/eventserver/usergroups/{group} (each group will have a URL)
The resulting XML that might be returned might look like the following:
<?xml version
=
"1.0" encoding
=
"UTF-8"?>
<usergroups_get_response xmlns
=
"http://www.devcow.com/api/1.0/">
<usergroup>SharePoint Users Group</usergroup>
<usergroup>.NET Users Group</usergroup>
</usergroups_get_response>
This can make programming an application very easy from client code such as JavaScript. In fact, the
code can return the result of the URL in any form desired. The returned data set could be sent back in the
form of XML, JSON, .NET, or even HTML, all of which are popular mechanisms for passing data around
the Internet. Because a web browser can display any HTML, developers could simply point their web
browsers to a resource that displays the output in HTML and let the browser take care of displaying the
output without any other programming.
SharePoint 2007 actually has a set of interfaces that are very similar to REST. In the documentation, they
are called the URL protocol. This references the way they are called more than the operations that are
described. These operations make use of a
dll
named
owssvr.dll
and specify the command that is
called as one of the parameters that is passed in. These calls are made from external applications as well
as the SharePoint web pages. One of the reasons that these URL protocol methods do not match the REST
architecture is that they are all based on the GET requests and require that the command be passed as
a parameter as stated above. When making a call to these methods, a similar pattern emerges that looks
like the following code.
http://Server_Name/[sites/][Site_Name/]_vti_bin/owssvr.dll?Cmd
=
Method_name[&Parameter1
=
Value1&Parameter2
=
Value2
...
]
In most cases, the return value is an XML string that represents CAML output. This CAML can be
decoded to display the requested information on a page. In some cases, it can display either XML or
22