Home
Developers

Developers

  • Documentation
    • Developer Guide
    • API Reference
    • Style Guide
    • How-To
    • Troubleshooting
  • Submit a Flake
  • Support

Pageflakes API Reference

  • Flake System Object
  • Flake User Object
  • Pageflakes Functions
  • Array Extensions
  • String Extensions
  • ContentProxy
    • HTTP GET Example
    • HTTP POST Example
    • ContentProxyResponse
    • GetUrl
    • GetUrl1
    • GetUrl2
    • GetUrl3
    • GetUrlNonCached
    • GetUrlNonCached2
    • FormPost
    • FormPost2
    • FormPost3
    • UploadString
    • UploadString2
  • App
  • RSS
  • Tooltip Manager
  • Public, Shared, and Private Pages
  • Server-Side Scripting
Home » Documentation » API Reference

ContentProxy

Most browsers don’t allow XMLHttpRequest to retrieve data from domains other than the domain where the script was fetched from, as shown in the diagram below.

ContentProxy1

Because of this security restriction, Pageflakes provides a content proxy server that can be used to fetch data from other domains. To do this, the flake makes a request to the proxy server. The proxy server then retrieves the content and returns it to the browser, as shown below.

ContentProxy1

The Content Proxy provides several methods:


ContentProxy.GetUrl(url, F(this, callbackFunction))
ContentProxy.FormPost(url, values, F(this, callbackFunction))
ContentProxy.UploadString(url, "content as string which is POSTed", F(this, callbackFunction));

If the call is successful, the content proxy invokes a function that was passed to it as callback.

The ContentProxy is set to cache any retrieved data for 10 minutes (GET calls only). Successive calls with the same parameters use the cached data rather than re-fetching the data from the remote server. This action optimizes flake performance. However, if updated data is required before the 15 minute interval, the GetURL or FormPost methods cannot be used.

Non-cached results can be retrieved using ContentProxy.getUrlNonCached(). The parameters are the same as ContentProxy.GetUrl().

  • HTTP GET Example
  • HTTP POST Example
  • ContentProxyResponse
  • GetUrl
  • GetUrl1
  • GetUrl2
  • GetUrl3
  • GetUrlNonCached
  • GetUrlNonCached2
  • FormPost
  • FormPost2
  • FormPost3
  • UploadString
  • UploadString2
‹ String ExtensionsupHTTP GET Example ›
»
  • Printer-friendly version