library_soa_services

Skip to end of metadata
Go to start of metadata

Page purpose...

  • To list information about the Library's service-oriented-architecture (SOA) web-services.

On this page...



Services...



Using services...

How to actually use these web-services?

In this section...


Consuming json via django...

  • Here's the 'views.py' function that displays this page:

Consuming json via php5...

PHP, since version 5.2.0, provides the 'json_decode' function. The following code will return open hours for the Rock as nested associative arrays (see Library Hours Service):

Consuming json via php...

  • Here's the php code that displays this page:
  • Note: the above code is using this php library that can encode and decode json. Other libraries would likely have a different implementation syntax.

Consuming json via javascript...

Javascript can only be executed on a local domain, so since the API's URL is http://library.brown.edu/services/hours/open_status_api_v1/rock/, this method will only work for pages that are located somewhere on the library.brown.edu server. The code below can be copied & pasted and relevant comments are denoted by //. I've broken it up into 3 steps: 1: define function that fetches the data; 2: store data to variables you can use later; 3: access those variables.


python POST...


python PUT or DELETE...


(Tags: APIs, DELETE, django, GET, javascript, json, php, PUT, POST, python, service oriented architecture, SOA, web services)


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.