makeRequest()
opensocial.makeRequest(url,callback,opt_param)
opensocial.Container.get().makeRequest(url,callback,opt_param)
Only port 80 is available at the moment.
The url you wish to be called.
The function you wish to be called with the results. The signature of the function should have at least one parameter (which will contain a reference to the data returned by the call).
A bucket for a set of standard OpenSocial parameters that tell the proxy how to behave. There is quite a bit of functionality accessible through the manipulation of this object.
In development (18/2/08): pass ContentRequestParameters.AuthenticationType.SIGNED into your makeRequest call. Doing so will cause OAUTH to digitally sign the request and will allow you to verify the identity of the viewer and owner.
Below is some example code that exercises opt_param to its fullest.
Example
var params = {}; // Lets makeRequest know that the result will be an XML document. params[opensocial.ContentRequestParameters.CONTENT_TYPE] = opensocial.ContentRequestParameters.ContentType.XML; // Sets the request method to POST (default is GET). params[opensocial.ContentRequestParameters.METHOD] = opensocial.ContentRequestParameters.MethodType.POST; // Adds two custom headers to the request. These headers will be passed on to the target. params[opensocial.ContentRequestParameters.HEADERS] = {"x-myheader":"myheadervalue", "x-myotherheader":"myotherheadervalue"}; // Tells the proxy to sign the request using OAuth. params[opensocial.ContentRequestParameters.AUTHORIZATION] = opensocial.ContentRequestParameters.AuthorizationType.SIGNED; opensocial.makeRequest(url, makeRequest_callback, params);
DataRequest()
ToDo
|