Jonth
New member
I have been trying to send this request through the 2captcha API, but the issue is everytime I send it VIA code it gives me the error: [ERR_INVALID_ARG_TYPE]: The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type object
Any help would be greatly apricated, I keep trying diffrent things but can't seem to get this request to send.
Any help would be greatly apricated, I keep trying diffrent things but can't seem to get this request to send.
Code:
var FormData = require('form-data');
var fs = require('fs');
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
const data = new FormData();
data.append("key", "96000001977a12e50ca4eb45f104fe1");
data.append("file", "file");
data.append("submit", "00000W0UAAAAAA-ouoKHOnWuQDNymSwDFYeGP300");
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://2captcha.com/in.php?key=962800000a12e50ca4eb45f104fe1&method=userrecaptcha&googlekey=000000UAAAAAA-ouoKHOnWuQDNymSwDFYeG00000&pageurl=https://www.google.com/recaptcha/api2/demo");
xhr.send(data); //problem area