During normal program flow, you may need to modify your application or
augment the server data sources, such as a database, with new content. To
meet this need, OpenSocial makes available an http
request method through the standard
JavaScript library.
Developers can use this method to make RESTful requests (GET, PUT, POST, DELETE) between the application and the server to alter their state without impacting the user experience.
The methods you can use to make these requests are all under the osapi.http
object and
include:
osapi.http.get(
url
,
params
)
osapi.http.put(
url
,
params
)
osapi.http.post(
url
,
params
)
osapi.http.delete(
url
,
params
)
In addition to the URL to make the http
request to, there are a number of
parameters you can introduce within these request calls. They are listed
in Table 6-2.
Table 6-2. http request parameters
Many of the requests used for insecure data will include only a
small portion of these parameters, including format
, body
for POST or PUT requests, and refreshInterval
to increase performance.
The authz
, sign_*
, and oauth_*
parameters may be introduced to the
request if you need to make a secure data request and verify the sender’s
identity.
3.149.240.196