Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. OpenSocial Activities, Sharing, and D... > Making AJAX and External Data Reques...

Making AJAX and External Data Requests

During normal program flow, you may need to modify your application or augment the server data sources, such as a database, with new content. To meet this need, OpenSocial makes available an http request method through the standard JavaScript library.

Developers can use this method to make RESTful requests (GET, PUT, POST, DELETE) between the application and the server to alter their state without impacting the user experience.

The methods you can use to make these requests are all under the osapi.http object and include:

  • osapi.http.get(url, params)

  • osapi.http.put(url, params)

  • osapi.http.post(url, params)

  • osapi.http.delete(url, params)

In addition to the URL to make the http request to, there are a number of parameters you can introduce within these request calls. They are listed in Table 6-2.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint