Hello! There is a situation I can not cope with, the thing is that I enter test sites using coockies (without that I am redirected to Google because of my ip) and then I work directly using the interface. But it became necessary to reduce time for testing by organizing the registration with the help of post request, and here a problem appeared. The fact is that when I send a request, I get an answer from google with 405 error that means that my cookie does not work in this case. Could you help me somehow?
function reg()
{
Switch_Cuk()
var GENDER = encodeURIComponent('male')
var CITY = encodeURIComponent('England London W1H Harcourt treet')
var DAY = encodeURIComponent('03')
var MONTH = encodeURIComponent('02')
var YEAR = encodeURIComponent('1965')
var MAIL = encodeURIComponent('jobs159+419a1@gmail.com')
var PASS = encodeURIComponent('Bothisatva')
var post = "YII_CSRF_TOKEN=&UserForm%5Bstep%5D=1&lid%5D=447ae708a0a911e292b2d4bed9a94a8f&UserForm%5Bgender%5D="+GENDER+"&UserForm%5Blocation%5D="+CITY+"&UserForm%5Bday%5D="+DAY+"&UserForm%5Bmonth%5D="+MONTH+"&UserForm%5Byear%5D="+YEAR+"&UserForm%5Bemail%5D="+MAIL+"&UserForm%5Bpassword%5D="+PASS
Log.Message(post)
var a = POSTa('
http://www.example/register' post)
Log.Message(a)
}
function POSTa(url, data)
{
var http = Sys.OleObject("MSXML2.ServerXMLHTTP.3.0");
var cook = Sys.Browser('firefox').Page("*").contentDocument.cookie
ShowMessage(cook)
http.open("POST", url, true);
ShowMessage(http.open("POST", url, false))
http.setRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
http.setRequestHeader("Cookie", cook);
http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
try{
http.send(data);
}
catch(e){
Log.Message(url);
Log.Message(data);
Log.Error(e+' msxml3.dll - the operation timed out');
return;
}
while(http.readyState!=4){
Delay(100);
}
return http.responseText;
}
function Switch_Cuk()
{
ip='31.42.50.94';
Sys.Browser(browsere).Page("*").ToUrl(example/admin');
Sys.Browser(browsere).Page("*").contentDocument.cookie = 'ip='+ip+'; path=/';
}