mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 07:21:43 +00:00
Update jsonrpc2.js
This commit is contained in:
parent
b45a7cdd6c
commit
b5bc2bd851
|
@ -2,19 +2,17 @@
|
|||
// JSON-RPC 2.0 wrapper for WelsonJS framework
|
||||
// Namhyeon Go <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
var HTTP = require("lib/http");
|
||||
|
||||
function JsonRpc2(url) {
|
||||
this.url = url;
|
||||
this.userAgent = "php-httpproxy/0.1.5 (Client; WelsonJS; abuse@catswords.net)";
|
||||
|
||||
|
||||
this.setUserAgent = function(agent) {
|
||||
this.userAgent = agent;
|
||||
};
|
||||
|
||||
|
||||
this.invoke = function(method, params, id) {
|
||||
var result;
|
||||
var response = HTTP.create("MSXML")
|
||||
var response = require("lib/http").create("MSXML")
|
||||
.setContentType("application/json")
|
||||
.setDataType("json")
|
||||
.setUserAgent(this.userAgent)
|
||||
|
|
Loading…
Reference in New Issue
Block a user