Update lib/http.js, testloader.js

This commit is contained in:
Namhyeon Go 2024-09-27 20:53:29 +09:00
parent 1e7061efae
commit a36dd8e257
2 changed files with 9 additions and 7 deletions

View File

@ -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;

View File

@ -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();