mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-11 00:15:14 +00:00
Update lib/http.js, testloader.js
This commit is contained in:
parent
1e7061efae
commit
a36dd8e257
11
lib/http.js
11
lib/http.js
|
@ -532,7 +532,10 @@ var HTTPObject = function(engine) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.engine == "MSXML") {
|
if (this.engine == "MSXML") {
|
||||||
// Open
|
// Get the proxied URL
|
||||||
|
url = this.getProxiedURL(url);
|
||||||
|
|
||||||
|
// Open the URL
|
||||||
switch (this.method) {
|
switch (this.method) {
|
||||||
case "POST":
|
case "POST":
|
||||||
this._interface.open(method, url, this.isAsynchronous);
|
this._interface.open(method, url, this.isAsynchronous);
|
||||||
|
@ -545,10 +548,10 @@ var HTTPObject = function(engine) {
|
||||||
default:
|
default:
|
||||||
console.warn("Switching the engine to cURL. Not supported method in MSXML: " + method);
|
console.warn("Switching the engine to cURL. Not supported method in MSXML: " + method);
|
||||||
this.setEngine("CURL");
|
this.setEngine("CURL");
|
||||||
console.log("Opened engine:", this.engine);
|
console.log("Use the engine:", this.engine);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("Opened engine:", this.engine);
|
console.log("Use the engine:", this.engine);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("HTTPObject.open() ->", e.message);
|
console.error("HTTPObject.open() ->", e.message);
|
||||||
|
@ -1210,7 +1213,7 @@ exports.parseURL = parseURL;
|
||||||
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
||||||
exports.defaultUserAgent = DEFAULT_USER_AGENT; // compatible
|
exports.defaultUserAgent = DEFAULT_USER_AGENT; // compatible
|
||||||
|
|
||||||
exports.VERSIONINFO = "HTTP REST Client (http.js) version 0.7.36";
|
exports.VERSIONINFO = "HTTP REST Client (http.js) version 0.7.37";
|
||||||
exports.AUTHOR = "abuse@catswords.net";
|
exports.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
|
@ -1007,7 +1007,7 @@ var test_implements = {
|
||||||
"proxy_custom_provider": function() {
|
"proxy_custom_provider": function() {
|
||||||
var HTTP = require("lib/http");
|
var HTTP = require("lib/http");
|
||||||
|
|
||||||
var response = HTTP.create("CURL")
|
var response = HTTP.create()
|
||||||
.setVariables({
|
.setVariables({
|
||||||
"api_key": "YOUR_API_KEY",
|
"api_key": "YOUR_API_KEY",
|
||||||
"render_js": "false",
|
"render_js": "false",
|
||||||
|
@ -1029,7 +1029,7 @@ var test_implements = {
|
||||||
"proxy_serp": function() {
|
"proxy_serp": function() {
|
||||||
var HTTP = require("lib/http");
|
var HTTP = require("lib/http");
|
||||||
|
|
||||||
var response = HTTP.create("CURL")
|
var response = HTTP.create()
|
||||||
.setVariables({
|
.setVariables({
|
||||||
"api_key": "YOUR_API_KEY"
|
"api_key": "YOUR_API_KEY"
|
||||||
})
|
})
|
||||||
|
@ -1038,7 +1038,6 @@ var test_implements = {
|
||||||
"provider": "searchapi",
|
"provider": "searchapi",
|
||||||
"type": "serp"
|
"type": "serp"
|
||||||
})
|
})
|
||||||
.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Trident/7.0; rv:11.0) like Gecko")
|
|
||||||
.open("GET", "https://www.google.com/search?q=test")
|
.open("GET", "https://www.google.com/search?q=test")
|
||||||
.send();
|
.send();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user