Database Reference
In-Depth Information
account e-mail address into valid OAuth2 credentials that can be used the
same way as the OAuth2 credentials generated in the previous section.
RESTful Web Services for the SOAP-Less Masses
Most Google APIs, including BigQuery, adhere to a REST model. REST is
one of those acronyms where knowing what it stands for doesn't actually
help you understand what it is. If you casually read the Wikipedia page for
Representational State Transfer ( http://en.wikipedia.org/wiki/
Representational_state_transfer ), you might not come away from
it knowing much more about REST or what people mean when they say
they have a REST API. Part of the problem is that REST can mean a variety
of different things, from the very broad to the very narrow. Here's an
explanation of REST in Google API context.
If you've been coding web services for a while, you likely have encountered
SOAP, which is a standard for describing and transmitting web API
requests. There are probably some good things about SOAP. It has a number
of downsides, however; it is complex to implement, highly verbose, and
most unfortunately, it uses XML. SOAP's popularity has been declining,
largely because people want an easier way to interact with their APIs while
still providing some structure.
Although REST has been around since HTTP 1.1 was defined in 1999, its
widespread use in web services is a much more recent phenomenon. People
realized that instead of creating fancy XML API descriptions to implement
SOAP, they could just make their web API look like something that was
already well understood—collections of files in the World Wide Web. As
many Java servlet developers realize, when you respond to a GET request
on a URL that ends with foo.txt , there doesn't have to be a file named
foo.txt —you can serve up whatever data you want to in response.
Moreover, the path portion of the URL, (for example, google/apis/v2/
foo.txt ) can carry important information, as well as can the trailing query
string (as in foo.text.?start_row ).
This is the central principle of REST—that you can make APIs that look
like requests for files, with URLs that provide key information about what
resources are requested. Sometimes, however, it requires a little bit of
wrangling to make an API fit a REST model.
Search WWH ::




Custom Search