2016-05-16

Question 5--Practice Final .

Submitters: Dennis Hsu Nick Gariaeff Khai Nguyen

  1. The web service's application state/method can be viewed as a resource.

That resource can be called using an URL, and you can tag a query to this URL to invoke a function to return the results you want.

Using REST, given the following URL: http://.../path/method/?arg1=val1&arg2=val2

The different parts are:

Object="http://.../path" Method="/method" Parameters="arg1=val1&arg2=val2"

An example of XMLHttpRequest:

query='http://www.yioop.com/s/news?f=rss&limit=20&num=30';

request= new XMLHttpRequest(); request.open("GET",query, true); request.onreadystatechange = function() { if (request.readyState == 4 && request.status==200){ alert(request.responseText); } }

request.send();

(Edited: 2016-05-16)
Submitters: Dennis Hsu Nick Gariaeff Khai Nguyen 5) The web service's application state/method can be viewed as a resource. That resource can be called using an URL, and you can tag a query to this URL to invoke a function to return the results you want. Using REST, given the following URL: http://.../path/method/?arg1=val1&arg2=val2 The different parts are: Object="http://.../path" Method="/method" Parameters="arg1=val1&arg2=val2" An example of XMLHttpRequest: query='http://www.yioop.com/s/news?f=rss&limit=20&num=30'; request= new XMLHttpRequest(); request.open("GET",query, true); request.onreadystatechange = function() { if (request.readyState == 4 && request.status==200){ alert(request.responseText); } } request.send();
X