Witam!
Mam mały problem z logowaniem. Konto jest testowe.
AutoIt
Kod:
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("POST", "http://www.datezone.com/index.php?action=logowanie&mode=zaloguj")
$oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.SetRequestHeader("Content-Type", "text/html; charset=UTF-8")
$oHTTP.Send("back=http%3A%2F%2Fwww.datezone.com%2F&login=humorek12&password=qwerty123&remember_me=on")
$Response = $oHTTP.ResponseText()
MsgBox(64,'',$Response)
Perl
Kod:
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $server_endpoint = "http://www.datezone.com/index.php?action=logowanie&mode=zaloguj";
# set custom HTTP request header fields
my $req = HTTP::Request->new(POST => $server_endpoint);
$req->header('content-type' => 'application/x-www-form-urlencoded');
$req->header('content-type' => 'text/html; charset=UTF-8');
# add POST data to HTTP request body
my $post_data = '{ "back": "http%3A%2F%2Fwww.datezone.com%2F", "login": "humorek12", "password": "qwerty123", "remember_me": "on" }';
$req->content($post_data);
my $resp = $ua->request($req);
if ($resp->is_success) {
my $message = $resp->content;
print "Received reply: $message\n";
}
else {
print "HTTP POST error code: ", $resp->code, "\n";
print "HTTP POST error message: ", $resp->message, "\n";
}
W AutoIt loguje, w Perlu nie.
W czym może tkwić problem?
Pozdrawiam.