SRL Archive - General

Need help with "PostHTTPPage"


Rune

2008-10-17 09:45:39

okay, I almost gave up on this, have tried everything..


I have a POST request like this, how do i send it ?
Do i need to make a client in memory with function InitializeHTTPClient ? Or use function OpenConnection ?
POST http://www.somewebsite.com/blabla/test/script.php HTTP/1.1
Host: www.somewebsite.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
Keep-Alive: 300
Proxy-Connection: keep-alive
Referer: www.google.com
Cookie: fusion_visited=yes; cookie_bla_bla
Content-Type: application/x-www-form-urlencoded
Content-Length: 43

px=some=data&here_test=blabla_test

If someone could make a example or explain how to do it, it would be very nice :)

Thanks,

/ Rune

Shady?

2008-10-18 15:13:03


procedure postit;
var
client : integer;
page : String;
begin
client:= InitializeHTTPClient( true, true );
SetHTTPUserAgent( client, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; da; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3');
addpostvariable( client, 'variable1', 'value for variable1');
addpostvariable( client, 'variable2', 'value for variable2');
page := PostHTTPPageEx( client, 'http://www.somewebsite.com/blabla/test/script.php' );
Writeln(page);
FreeHTTPClient(Client);
end;

Something arround that lines would do it.. If it does not work or something just tell me, as i just made this up, didn't test.

Rune

2008-10-18 17:09:22

Thanks for helping me . :)

I get "Unexpected end of file"

What is the " value for variable1 " used for ?