English | Site Directory

gadgets.io

 SUMMARY     DETAIL

Static Class gadgets.io

Provides remote content retrieval functions.

Method Summary

<static>  String encodeValues(fields)
Converts an input object into a URL-encoded data string.
<static>  String getProxyUrl(url)
Gets the proxy version of the passed-in URL.
<static> makeRequest(url, callback, opt_params)
Fetches content from the provided URL and feeds that content into the callback function.
 

Method Detail

encodeValues

<static> String encodeValues(fields)
    Converts an input object into a URL-encoded data string. (key=value&...)
    Parameters:
      Object fields - The post fields you wish to encode
    Returns:
      String The processed post data; this will include a trailing ampersand (&)

getProxyUrl

<static> String getProxyUrl(url)
    Gets the proxy version of the passed-in URL.
    Parameters:
      String url - The URL to get the proxy URL for
    Returns:
      String The proxied version of the URL

makeRequest

<static> makeRequest(url, callback, opt_params)
    Fetches content from the provided URL and feeds that content into the callback function. Example:
    var params = {};
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;
    gadgets.io.makeRequest(url, callback, params);
    
    Parameters:
      String url - The URL where the content is located
      Function callback - The function to call with the data from the URL once it is fetched
      Map.<gadgets.io.RequestParameters, Object> opt_params - Additional parameters to pass to the request

Documentation generated by JsDoc Toolkit 1.3.3