for example the first request grabs a file(sends a cookie and receives a file using post) and in the second one i want to send that file that i received to my server.
http = new XMLHttpRequest();
const url = 'test.com/file.img';
http.open('post', url, true);
http.responseType = "blob";
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
test = http.response
var http2 = new XMLHttpRequest();
http2.open("post", 'myserver/process.php', true);
http2.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http2.send(test);