I've been getting asked about this quite a bit, so I'll preemptively dump some info here.
var param = {};
param[opensocial.ContentRequestParameters.AUTHORIZATION] = opensocial.ContentRequestParameters.AuthorizationType.SIGNED; //Not implemented yet
param[opensocial.ContentRequestParameters.METHOD] = opensocial.ContentRequestParameters.MethodType.GET; // POST for POST_DATA param[opensocial.ContentRequestParameters.CONTENT_TYPE] = opensocial.ContentRequestParameters.ContentType.HTML; // only HTML is supported, but the content type is currently determined by the response - application/json is commonly used
// Certain headers are not modifiable, including those provided for you (Connection, Content-Length, Content-Type, Method)
param[opensocial.ContentRequestParameters.HEADERS] = {'header_name': 'header_value'}; //JSON style naming <string(header name),string(header value)>
param[opensocial.ContentRequestParameters.POST_DATA] = "key1=value1&key2=value2";
opensocial.makeRequest(url, makeRequest_callback, param);
function makeRequest_callback(response, error) { if (!error) var content = response.responseText; }
As always, feel free to post if you have any problems.
Max