Tour API Demos Download Tests
Aperture version 1.0
Generated by: JsDoc Toolkit 2.4.0

Namespace aperture.io

APIs for client / server interaction.

Namespace Summary
Constructor Attributes Constructor Name and Description
 

Method Summary

Namespace Detail

aperture.io
Requires:
jQuery
json2 as a JSON shim if running old browsers

Method Detail

  • <static> aperture.io.rest(uri, method, callback, opts)
    Makes a REST call to the server for the given URI, method, and posted data block. Callback for onSuccess and onError may be provided.
    Parameters:
    {String} uri
    The URI to which to make the ajax
    {String} method
    The HTTP method to use, must be a valid HTTP verb such as GET or POST
    {Function(data|Object)} callback
    A callback function to be used when the ajax call returns. Will be called on both success and error conditions. The first parameter will contain a data payload: if JSON, will automatically be converted into an object. The second parameter is an object that contains various ajax response values including: success - a boolean, true when the ajax call was successful; xhr - the XHR object; status - a string containing the HTTP call status; errorThrown - on error, the error that was thrown.
    {Object} opts
    an options object
    {String} opts.postData
    data to post if the POST verb is used, will be automatically converted to a string if given an object
    {String|Object} opts.params
    parameters to include in the URL of a GET request. Will automatically be converted to a string if given a hash
    {Object} opts.headers
    additional headers to set as key:value pairs
    {String} opts.contentType
    explicit content type used when POSTing data to the server.
  • <static> aperture.io.restUrl(uri)
    Resolves a relative uri to a rest url TODO handle non-relative URIs
    Parameters:
    uri
  • <static> aperture.io.setUrlAuthenticator(fn)
    Sets a function that can be used to add security information to a URL before it is used to make an RPC call to the server. This permits implementation-specific (token-based) authentication.
    Parameters:
    fn