Ticket #476 (closed Enhancement: fixed)

Opened 12 years ago

Last modified 12 years ago

enable sending of async requests for users of the rest_client.js

Reported by: Malte Owned by: jri
Priority: Major Milestone: Release 4.2
Component: DeepaMehta Standard Distribution Version: 4.1
Keywords: Cc:
Complexity: 1 Area: Application Framework / API
Module: deepamehta-webclient

Description

throuhg providing a public mehtod like, e.g.:

+    this.asyncRequest = function(method, uri, data, callback, headers, response_data_type) {
+        return request(method, uri, data, callback, headers, response_data_type, true)     // callback=undefined
+    }

Change History

comment:1 Changed 12 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 12 years ago by jri

REST Client: send asynchronous requests (#476).

Plugins providing a REST service can send the respective requests asynchronously.

BREAKING CHANGE

REST Client: the dm4c.restc.request() method has an additional "callback" parameter (the 4th parameter).

request = function(method, uri, data, callback, headers, response_data_type)

Description of the "callback" parameter:

Optional: the function to be called if the request is successful.
One argument is passed: the data returned from the server.
If not specified, the request is send synchronously.

If your plugins uses that method with more than 3 parameters -- that is if you pass "headers" or "response_data_type" you must adapt the respective calls. To keep your plugin's current request semantic -- that is synchronous requests -- pass undefined as the 4th parameter.
However, very few plugins should be affected.

Changeset: a57a096caf787d231cf38e7bbc5af6f9b90dfcad

comment:3 Changed 12 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.