POST method??

Cableguy

Expert
Licensed User
Longtime User
Hi guys..

Im thinking of writing an app to access an online game...

this game requires a login, so viewing the login page souce-code this pops out as being the key line to work with:

B4X:
<form method="post" name="snd" action="somepage.php"

a few lines below I have the actual logintext fields, named "name" and "password"...

my question is:

If I want to go directly to "somepage.php" with going through the login page, Must I use a POST method? if so, how would I code that?

Many Thanks in advance.
 

Cableguy

Expert
Licensed User
Longtime User
Tried that method, using the modules EREL provided, but no luck....

any Idea? I can post th "loging form" portion of the page source code if it helps
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I think I am mssing a parameter...
My problem is, if I m right, that parameter is a "session number# that I must first read and after send in the post method...
This causes another problem, as I cant seem to ge the "Getstring" method to work..
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
The best way that I have found to sort out the login is to use Mozilla Firefox with either 'Live HTTP Headers' or 'Firebug' to monitor the log-on, then log into the game/site and the monitor app will show the Post URL and the Post Data (post content) then use HttpUtils
B4X:
HttpUtils.PostString ("POST Job1", PostUrl, PostData)
to send the request.
Edward
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Ok, so I've got to the point were:

1 - I read the Login page in order to retrieve a hidden value that is passed in the POST string...
2 - I build the string and send the request, wich Fails...

Using LiveHttps on Firefox, this is what I get when I do a normal Login:

B4X:
http://ts4.travian.pt/dorf1.php

POST /dorf1.php HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DITNhlTM3QGMlBjOzAjNycjNxojM3cDMyUTM6cDOxcDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D
Content-Type: application/x-www-form-urlencoded
Content-Length: 67
name=cableguy&password=tuga&s1=Entrar&w=1024%3A600&login=1320347250
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:08:10 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: lowRes=0; path=/; httponly
Set-Cookie: T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; path=/; httponly
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:08:10 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/stats.php?p=h3c&login=1320347290

GET /stats.php?p=h3c&login=1320347290 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:08:10 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/stats.php?p=h3c&login=1320347290

GET /stats.php?p=h3c&login=1320347290 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:08:12 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/stats.swf?id=1697932|6f94ec

GET /stats.swf?id=1697932|6f94ec HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:08:14 GMT
Content-Type: application/x-shockwave-flash
Content-Length: 1875
Last-Modified: Sat, 24 Oct 2009 18:57:44 GMT
Connection: keep-alive
Accept-Ranges: bytes
----------------------------------------------------------
http://ts4.travian.pt/stats.php?p=c75&login=1320347290

GET /stats.php?p=c75&login=1320347290 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:08:14 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/gpack/travian_Travian_4.0_Grisu/img/hero/danger.gif

GET /gpack/travian_Travian_4.0_Grisu/img/hero/danger.gif HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 404 Not Found
Server: nginx
Date: Thu, 03 Nov 2011 19:08:14 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/gpack/travian_Travian_4.0_Grisu/img/a/resAll-ltr.gif

GET /gpack/travian_Travian_4.0_Grisu/img/a/resAll-ltr.gif HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 404 Not Found
Server: nginx
Date: Thu, 03 Nov 2011 19:08:14 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/gpack/travian_Travian_4.0_Grisu/img/a/att_all.gif

GET /gpack/travian_Travian_4.0_Grisu/img/a/att_all.gif HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 404 Not Found
Server: nginx
Date: Thu, 03 Nov 2011 19:08:14 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/stats.php?p=f4c&id=1697932%7C6f94ec%3A1672603%7C9923e1

GET /stats.php?p=f4c&id=1697932%7C6f94ec%3A1672603%7C9923e1 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:08:14 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/build.php?newdid=57781&id=3

GET /build.php?newdid=57781&id=3 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:09:42 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:09:42 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts2.travian.fr/build.php?newdid=73507&id=13

GET /build.php?newdid=73507&id=13 HTTP/1.1
Host: ts2.travian.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts2.travian.fr/dorf1.php
Cookie: t4level=1; CAD=139398652%231319825228%230%230%23%230; sess_id=05804956d4444d5a9961f2a5b722e4bb; lowRes=0; T3E=5YTY5UzMiNzYlpDNyUDOyYjM6gzM1MDN6cDOxcDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:09:42 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: T3E=mhDO0MjMjdDZhpDNyUDOyYjM6gzM1MDN6IDOzcDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; path=/; httponly
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:09:42 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts2.travian.fr/build.php?newdid=73507&id=13

GET /build.php?newdid=73507&id=13 HTTP/1.1
Host: ts2.travian.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts2.travian.fr/dorf1.php
Cookie: t4level=1; CAD=139398652%231319825228%230%230%23%230; sess_id=05804956d4444d5a9961f2a5b722e4bb; lowRes=0; T3E=mhDO0MjMjdDZhpDNyUDOyYjM6gzM1MDN6IDOzcDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:10:49 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:10:49 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/build.php?newdid=57781&id=3

GET /build.php?newdid=57781&id=3 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DMGM5MmY0kjZygjOyMTO3kjNxojM3cDMyUTM6ATOycDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:10:49 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: T3E=%3DQGN1UmN3YzMkZjOyMTO3kjNxojM3cDMyUTM6kDN0cDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; path=/; httponly
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:10:49 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/build.php?newdid=57781&id=3

GET /build.php?newdid=57781&id=3 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DQGN1UmN3YzMkZjOyMTO3kjNxojM3cDMyUTM6kDN0cDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:11:13 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:11:13 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts2.travian.fr/build.php?newdid=73507&id=13

GET /build.php?newdid=73507&id=13 HTTP/1.1
Host: ts2.travian.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts2.travian.fr/dorf1.php
Cookie: t4level=1; CAD=139398652%231319825228%230%230%23%230; sess_id=05804956d4444d5a9961f2a5b722e4bb; lowRes=0; T3E=mhDO0MjMjdDZhpDNyUDOyYjM6gzM1MDN6IDOzcDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:11:46 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: T3E=iN2YjNGN1UGM2oDNyUDOyYjM6gzM1MDN6YDM1cDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; path=/; httponly
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:11:46 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/build.php?newdid=57781&id=3

GET /build.php?newdid=57781&id=3 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DQGN1UmN3YzMkZjOyMTO3kjNxojM3cDMyUTM6kDN0cDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:12:14 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:12:14 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts2.travian.fr/build.php?newdid=73507&id=13

GET /build.php?newdid=73507&id=13 HTTP/1.1
Host: ts2.travian.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts2.travian.fr/dorf1.php
Cookie: t4level=1; CAD=139398652%231319825228%230%230%23%230; sess_id=05804956d4444d5a9961f2a5b722e4bb; lowRes=0; T3E=iN2YjNGN1UGM2oDNyUDOyYjM6gzM1MDN6YDM1cDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:12:43 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:12:43 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/build.php?newdid=57781&id=3

GET /build.php?newdid=57781&id=3 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DQGN1UmN3YzMkZjOyMTO3kjNxojM3cDMyUTM6kDN0cDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:13:22 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: T3E=%3DEGMkZTYwgDZiljOyMTO3kjNxojM3cDMyUTM6IDM2cDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; path=/; httponly
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:13:22 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts2.travian.fr/build.php?newdid=73507&id=13

GET /build.php?newdid=73507&id=13 HTTP/1.1
Host: ts2.travian.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts2.travian.fr/dorf1.php
Cookie: t4level=1; CAD=139398652%231319825228%230%230%23%230; sess_id=05804956d4444d5a9961f2a5b722e4bb; lowRes=0; T3E=iN2YjNGN1UGM2oDNyUDOyYjM6gzM1MDN6YDM1cDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:13:51 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: T3E=2EDNilDOzgTOyoDNyUDOyYjM6gzM1MDN6EzM2cDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; path=/; httponly
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:13:51 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts2.travian.fr/build.php?newdid=73507&id=13

GET /build.php?newdid=73507&id=13 HTTP/1.1
Host: ts2.travian.fr
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts2.travian.fr/dorf1.php
Cookie: t4level=1; CAD=139398652%231319825228%230%230%23%230; sess_id=05804956d4444d5a9961f2a5b722e4bb; lowRes=0; T3E=2EDNilDOzgTOyoDNyUDOyYjM6gzM1MDN6EzM2cDNzAjMzEjOwojMkRWO0UTYyUGMxEzY1ETOkRGM4IjZmZWYidTM2IWYmZGZkFzYxkTO6QWavJHZhdWd0pTM0ADN6EDNwQzIxQDM0MSM0ADN; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:14:49 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:14:49 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/build.php?newdid=57781&id=3

GET /build.php?newdid=57781&id=3 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DEGMkZTYwgDZiljOyMTO3kjNxojM3cDMyUTM6IDM2cDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:14:49 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:14:49 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------
http://ts4.travian.pt/build.php?newdid=57781&id=3

GET /build.php?newdid=57781&id=3 HTTP/1.1
Host: ts4.travian.pt
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: */*
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Referer: http://ts4.travian.pt/dorf1.php
Cookie: sess_id=c3dbdfe1199e04a2b5a2e9783f5b176a; lowRes=0; T3E=%3DEGMkZTYwgDZiljOyMTO3kjNxojM3cDMyUTM6IDM2cDNzAjMzEjOwojY0QDZzgDNjZTO3cjYwQmNiFDZ2I2YiBjNmJ2NxQjNkBjMiRjNkBjN6kXdnVGbiF2Q6MzMzMTM6MzMzMTMjMzMzMTMjMzMzMTM; orderby2=0; mapId1=%7B%22grid%22%3Atrue%7D

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 03 Nov 2011 19:15:13 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 03 Nov 2011 19:15:13 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
----------------------------------------------------------

This seems to do a lot more that just redirect to the "dorf1.php" page that is the default one every time one enters the game.

SO waht exactly should I be POSTing???
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
This seems to do a lot more that just redirect to the "dorf1.php" page that is the default one every time one enters the game.

SO waht exactly should I be POSTing???

You POST string should be:
B4X:
name=cableguy&password=tuga&s1=Entrar&w=1024%3A600&login=1320347250

However it does look like a lot of URLs are being fetched after the initial log in.

What error do you get when you do HttpUtils? Try writing the response to an html file and opening it on a browser (if it is a web based error). Or look into the logs to see what the server response is.

EDIT:
Tried the post with the URL on apikitchen.org. It works fine and returns an html file. Not sure what you would want to do with that.
 
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Cant seem to find apikitchen.org...
 
Upvote 0
Top