diff options
Diffstat (limited to 'lib/httpsync.js')
-rw-r--r-- | lib/httpsync.js | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/lib/httpsync.js b/lib/httpsync.js index a638cfe94..478779c4b 100644 --- a/lib/httpsync.js +++ b/lib/httpsync.js @@ -30,37 +30,12 @@ var HttpSyncProvider = function (host) { this.host = host || 'http://localhost:8080'; }; -/// Transforms inner message to proper jsonrpc object -/// @param inner message object -/// @returns jsonrpc object -function formatJsonRpcObject(object) { - return { - jsonrpc: '2.0', - method: object.call, - params: object.args, - id: object._id - }; -} - -/// Transforms jsonrpc object to inner message -/// @param incoming jsonrpc message -/// @returns inner message object -function formatJsonRpcMessage(message) { - var object = JSON.parse(message); - - return { - _id: object.id, - data: object.result, - error: object.error - }; -} - HttpSyncProvider.prototype.send = function (payload) { - var data = formatJsonRpcObject(payload); + //var data = formatJsonRpcObject(payload); var request = new XMLHttpRequest(); request.open('POST', this.host, false); - request.send(JSON.stringify(data)); + request.send(JSON.stringify(payload)); // check request.status return request.responseText; |