Update jsonrpc2.js

This commit is contained in:
Namhyeon Go 2024-11-24 02:20:44 +09:00
parent b45a7cdd6c
commit b5bc2bd851

View File

@ -2,19 +2,17 @@
// JSON-RPC 2.0 wrapper for WelsonJS framework // JSON-RPC 2.0 wrapper for WelsonJS framework
// Namhyeon Go <abuse@catswords.net> // Namhyeon Go <abuse@catswords.net>
// https://github.com/gnh1201/welsonjs // https://github.com/gnh1201/welsonjs
var HTTP = require("lib/http");
function JsonRpc2(url) { function JsonRpc2(url) {
this.url = url; this.url = url;
this.userAgent = "php-httpproxy/0.1.5 (Client; WelsonJS; abuse@catswords.net)"; this.userAgent = "php-httpproxy/0.1.5 (Client; WelsonJS; abuse@catswords.net)";
this.setUserAgent = function(agent) { this.setUserAgent = function(agent) {
this.userAgent = agent; this.userAgent = agent;
}; };
this.invoke = function(method, params, id) { this.invoke = function(method, params, id) {
var result; var result;
var response = HTTP.create("MSXML") var response = require("lib/http").create("MSXML")
.setContentType("application/json") .setContentType("application/json")
.setDataType("json") .setDataType("json")
.setUserAgent(this.userAgent) .setUserAgent(this.userAgent)