Action: CALL_URL

This action is used to contact a remote server to get data or to save data. The attribute request_type is used to determine the direction of data flow. The request_type can be following

  • GET is used to retrieve data from a specific URI

  • POST is used to send the data to the specific URI

  • PUT is used to save the data at a specific URI. See the Difference between PUT and POST.

  • DELETE is used to delete the data at a specific URI

    Attributes

    Value

    Mandatory

    action_name

    CALL_URL

    Yes

    event_list

    comma separated list of events, eg: TAP

    Yes

    target

    URL to call. The target can take parameterized URL and it will be deparameterized before invoking. See what is parameterization

    Yes

    remote_request_type

    GET, POST, PUT or DELETE. Default is GET

    No

    run_in_background

    true or false. Default is true. If true, remote call is executed in the background thread and the application is still responsive to user’s gestures. If false, the application does not respond to user’s gestures and appears to be frozen until the remote call is finished.

    No

    remote_data_format

    JSON or IMAGE. Default is JSON.

    No

    remote_data_save_locally

    true or false. Default is true. If true, an attempt is made to save data locally. Images are cached on the device.

    No

    update_screen

    true or false. Default is true. If true, the data fetched from the remote server is updated on the screen as well.

    No

Examples

Example 1 Fetch the remote data on the tap.

<action event_list="TAP" action_name="CALL_URL"
    target="http://www.swimdash.com/swimdash/index/index/format/json/category/<id>"
    input_parameter_list="CONSTANT:3" target_parameter_list="id"/>

Example 2 See the tutorial Save data to remote. In this example, you will see how the remote data is fetched when the screen is resumes, saved locally and then the list box is driven off that freshly fetched data.