gadgets.io
- Method
- gadgets.io.AuthorizationType
- gadgets.io.ContentType
- gadgets.io.MethodType
- gadgets.io.ProxyUrlRequestParameters
- gadgets.io.RequestParameters
- gadgets.io.RequestParameters.AUTHORIZATION
- gadgets.io.RequestParameters.CONTENT_TYPE
- gadgets.io.RequestParameters.NUM_ENTRIES
- gadgets.io.RequestParameters.GET_SUMMARIES
- gadgets.io.RequestParameters.HEADERS
- gadgets.io.RequestParameters.METHOD
- gadgets.io.RequestParameters.POST_DATA
- gadgets.io.RequestParameters.REFRESH_INTERVAL
Method
gadgets.io.encodeValues
Converts the input object into a URL-encoded data string(key=value&...)
Parameter
Name |
Type |
Description |
---|---|---|
fields |
Object |
The POST data to be encoded |
Return value
Type |
Description |
---|---|
String |
Processed POST data. An ampersand (&) is added to the end. |
Sample
gadgets.io.getProxyUrl
Not supported.
gadgets.io.makeRequest
Acquires contents from the specified URL. Results are returned to the callback function.gadgets.io.RequestParameters.
If a value other than gadgets.io.ContentType.TEXT is assigned as the CONTENT_TYPE, the object data field, which can be received as a callback function, will be converted into an appropriate JS object according to the assigned ContentType. For example, if DOM is assigned, it will be converted into a JS object in which a DOM tree structure is nested, and if JSON is assigned, it will be a JS object that maintains a JSON structure. The unconverted, original response body can be acquired in the text field.
Parameter
Name |
Type |
Description |
---|---|---|
url |
String |
The URL that contains the contents. |
callback |
Function |
The callback function that is called after the contents are acquired and the results turned into arguments. |
opt_params |
Map.<gadgets.io.RequestParameters, Object> |
gadgets.io.RequestParameters or gadgets.io.ProxyUrlRequestParameters |
Return value
None
Sample
gadgets.io.AuthorizationType
gadgets.io.AuthorizationType.NONE
A request without authorization.
gadgets.io.AuthorizationType.SIGNED
A signed request according to the container.
gadgets.io.AuthorizationType.OAUTH
Not supported.
gadgets.io.ContentType
gadgets.io.ContentType.TEXT
Returns text. It is used to acquire HTML.
gadgets.io.ContentType.DOM
Returns a DOM object. It is used to acquire XML.
gadgets.io.ContentType.JSON
Returns JSON.
gadgets.io.ContentType.FEED
Returns a JSON string of an RSS/Atom feed.
gadgets.io.MethodType
gadgets.io.MethodType.GET
Specifies the HTTP method GET when acquiring contents. This is the default.
gadgets.io.MethodType.POST
Specifies the HTTP method POST when acquiring contents.
gadgets.io.MethodType.PUT
Specifies the HTTP method PUT when acquiring contents.
gadgets.io.MethodType.DELETE
Specifies the HTTP method DELETE when acquiring contents.
gadgets.io.MethodType.HEAD
Specifies the HTTP method HEAD when acquiring contents.
gadgets.io.ProxyUrlRequestParameters
gadgets.io.ProxyUrlRequestParameters.REFRESH_INTERVAL
Not supported.
gadgets.io.RequestParameters
gadgets.io.RequestParameters.AUTHORIZATION
The type of authentication used when acquiring contents. The default is AuthorizationType.NONE.
gadgets.io.RequestParameters.CONTENT_TYPE
The type of contents. The default is ContentType.TEXT.
gadgets.io.RequestParameters.NUM_ENTRIES
The number of entries acquired when the contents are fed. The default is 3.
gadgets.io.RequestParameters.GET_SUMMARIES
It indicates whether or not a feed summary is acquired when the contents are fed. The default is false.
gadgets.io.RequestParameters.HEADERS
The HTTP header specified when acquiring contents. The default is null.
gadgets.io.RequestParameters.METHOD
The HTTP method used when acquiring contents. The default is MethodType.GET.
gadgets.io.RequestParameters.POST_DATA
The data sent using the POST method when acquiring contents. The default is null.
gadgets.io.RequestParameters.REFRESH_INTERVAL
The number of seconds the container should cache the given response. The default is 3600.
Specifying 0 means no cache for any requests.
Revision History
- 09/11/2012
- Add description for gadgets.io.RequestParameters.REFRESH_INTERVAL
- 12/2010
- Initial Release.