mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +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 {
|
||||
if (this.engine == "MSXML") {
|
||||
// Open
|
||||
// Get the proxied URL
|
||||
url = this.getProxiedURL(url);
|
||||
|
||||
// Open the URL
|
||||
switch (this.method) {
|
||||
case "POST":
|
||||
this._interface.open(method, url, this.isAsynchronous);
|
||||
|
@ -545,10 +548,10 @@ var HTTPObject = function(engine) {
|
|||
default:
|
||||
console.warn("Switching the engine to cURL. Not supported method in MSXML: " + method);
|
||||
this.setEngine("CURL");
|
||||
console.log("Opened engine:", this.engine);
|
||||
console.log("Use the engine:", this.engine);
|
||||
}
|
||||
} else {
|
||||
console.log("Opened engine:", this.engine);
|
||||
console.log("Use the engine:", this.engine);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("HTTPObject.open() ->", e.message);
|
||||
|
@ -1210,7 +1213,7 @@ exports.parseURL = parseURL;
|
|||
exports.DEFAULT_USER_AGENT = DEFAULT_USER_AGENT;
|
||||
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.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
|
@ -1007,7 +1007,7 @@ var test_implements = {
|
|||
"proxy_custom_provider": function() {
|
||||
var HTTP = require("lib/http");
|
||||
|
||||
var response = HTTP.create("CURL")
|
||||
var response = HTTP.create()
|
||||
.setVariables({
|
||||
"api_key": "YOUR_API_KEY",
|
||||
"render_js": "false",
|
||||
|
@ -1029,7 +1029,7 @@ var test_implements = {
|
|||
"proxy_serp": function() {
|
||||
var HTTP = require("lib/http");
|
||||
|
||||
var response = HTTP.create("CURL")
|
||||
var response = HTTP.create()
|
||||
.setVariables({
|
||||
"api_key": "YOUR_API_KEY"
|
||||
})
|
||||
|
@ -1038,7 +1038,6 @@ var test_implements = {
|
|||
"provider": "searchapi",
|
||||
"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")
|
||||
.send();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user