Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST method not working #4

Open
ActiniumTO opened this issue Jan 31, 2023 · 3 comments
Open

POST method not working #4

ActiniumTO opened this issue Jan 31, 2023 · 3 comments

Comments

@ActiniumTO
Copy link

The POST method not working, test it.

@HypePhilosophy
Copy link
Owner

Working on my end, send me your code/any errors you get.

@ActiniumTO
Copy link
Author

Every post request ends with the website reacts with 400 REQUEST BAD, check it.

@ActiniumTO
Copy link
Author

Trying with simple request tool to request with POST method this website : https://httpbin.org/post
(The tool used: https://reqbin.com)
image

responds 200 statusCode.

with your code:
var cookieJar = new CookieJar();
process.on("uncaughtException", (err) => {
console.warn(err);
});

/*
setInterval(() => {
try {
testTLS();
} catch (err) {
console.warn(err);
}
});
*/

// testPeetTLS();
// testZalando();
async function testTLS() {
let options = {
method: "POST",
//body: '',
//proxy: "socks5://foo:bar@,
cookieJar: cookieJar,
headers: {
"Accept": "/",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9,he;q=0.8,zh-CN;q=0.7,zh;q=0.6,ru;q=0.5",
"Content-Length": "0",
"Content-Type": "application/json",
"Host": "httpbin.org",
"Sec-Ch-Ua": ""Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"",
"Sec-Ch-Ua-Mobile": "?0",
"Sec-Ch-Ua-Platform": ""Windows"",
"Sec-Fetch-Dest": "empty",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Site": "none",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
},
//json: {"hey": "hey"}
};

let GetResp = await turnt("https://httpbin.org/post", options);

// console.log(GetResp.body);

console.log(GetResp.body, GetResp.status);
}

testTLS()

the response is 400 statusCode :

<title>400 Bad Request</title>

400 Bad Request

400 Done in 0.89s. And this is for every site you try with POST, GET method works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants