HTTP service
From Forum Nokia Wiki
Contents |
The service
With the HTTP service the script can execute HTTP GET and HTTP POST methods. If the MIME type of the response is human readable text ("text/..."), the response is a string, otherwise it is binary. The output of the HTTP service can be processed with a filter. (See Advanced filters.)
The HTTP service can have the following service parameters that are configured in the XML configuration:
| Service parameter | Function |
|---|---|
| auth | When using TOKEN authentication, the service id of the tokenauth type service must be set here. (See Token Authentication for an example.) |
HTTP service has two actions that are called from the script code:
| Service action | Function |
|---|---|
| get | get executes a HTTP GET to the URL specified. |
| post | post executes a HTTP POST to the URL specified. |
With get and post actions, additional request parameters can be added. In get, only the string type parameters will be appended to the querystring, and in post depending on the nature of the parameters they will be either sent as:
Content-Type: application/x-www-form-urlencoded; charset=utf-8
when all parameter values are strings
OR
Content-Type: multipart/form-data
when there are also other types of parameter values than strings. The values of other types must be accompanied with the MIME type of the data.
Service actions
The following are the specifications for the available service actions.
Get
/* Action get */ input = (use FetchInput) output = (use Content)
Post
/* Action post */ input = (use FetchInput) output = (use Content)
Content = (choice (string textContent)
(bytes dataContent)
(any filteredData)
(null noData))
Headers = (list (repeat (bind (string name) (string value))))
FetchInput = (list (bag (bind (const url)
(string urlToFetch))
(optional (bind (const params)
(list (repeat (use RequestParameter)))))
(optional (bind (const enccharset)
(string urlEncCharset)))
(optional (bind (const headers)
(use Headers)))))
RequestParameter = (bind (string paramName)
(choice (string paramValue)
(int paramValue)
(boolean paramValue)
(list (string mimeType)
(bytes data))))
Code example
See also
- Getting content with Services
- Available content fetching services
- Syndication service
- Webfeed service
- HTTP service
- Fetcher details
- Advanced filters
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bluetooth Service Registration | kates | Bluetooth Technology | 5 | 2005-01-23 14:02 |
| How to sell game, download service, billing? | big_pig | Mobile Java Games | 2 | 2006-12-19 18:18 |
| Web service | JTOne | Symbian Networking & Messaging | 0 | 2007-09-09 21:19 |
| Using mncnnotification? | tcalamawy | Symbian Networking & Messaging | 18 | 2008-06-25 20:50 |
| Nokia Unlock Service Midlet availability | arip. | Near Field Communication | 0 | 2007-11-21 13:45 |

