Witam. Chciałem zautomatyzować trochę grę we flashu. Dane wysyła PostDatą w xhtmlu. W Firefoxie zainstalowałem "Dane Tamper" który przechwytuje dane Post i Get. Wyłuskałem coś takiego (puszczona wiadomość na głównym chacie "Witam wszystkich"):
Host=11.11.11.11
User-Agent=Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0
Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language=pl,en-us;q=0.7,en;q=0.3
Accept-Encoding=gzip, deflate
Connection=keep-alive
Referer=http://static13.cdn.ubi.com/costam/live/pl/L4818pl/SWMMO/debug/SWMMO.swf
Content-type=text/xml
Content-length=308
POSTDATA =<body xmlns="http://jabber.org/protocol/httpbind" sid="abc1234" rid="333333"><message to="global-1@conference.11.11.11.11" id="m_116" type="groupchat" from="denwer@11.11.11.11"><body>Witam wszystkich</body><bbmsg playerid="222222" xmlns="bbmsg" playername="denwer" playertag="null" /></message></body>
Wymodziłem taki kod
var param:TStringList;
valid:boolean;
url,text:string;
http:TIDHttp;
begin
http := TIDHttp.Create(nil);
http.HandleRedirects := true;
http.ReadTimeout := 5000;
param:=TStringList.create;
param.Clear;
param.Add('<body xmlns="http://jabber.org/protocol/httpbind" sid="e3ddf2a6" rid="134332">');
param.Add('<message to="global-1@conference.31.222.128.215" id="m_116" type="groupchat" from="denwer@31.222.128.215">');
param.Add('"<body>Witam wszystkich</body><bbmsg playerid="134332" xmlns="bbmsg" playername="denwer" playertag="null" /></message></body>');
valid:=true;
url:='http://31.222.128.215/';
try
text:=http.Post(url,param);
except
on E:Exception do
begin
valid:=false;
end;
end;
if valid then
PostData.Text:= text
else
PostData.Text := '';
end;
, ale jak naciskam buttona to wypluwa mi komunikat poniżej
<html>
<head><title>Openfire HTTP Binding Service</title></head>
<body><font face="Arial, Helvetica"><b>Openfire <a href="http://www.xmpp.org/extensions/xep-0124.html">HTTP Binding</a> Service</b></font></body>
</html>
Oczywiście ip, strona, rid i sid zmieniłem dla potrzeb postu.
Zauważyłem że rid zwiększa się co jakiś czas. Macie jakiś pomysł co robię nie tak ? Z IDhttp i datapostem nie miałem wcześniej do czynienia.