SRL Archive - General

Sending request to server.


Rune

2007-05-13 15:46:52

Hi (:

Can Scar be used for sending request to a server ?
Something like:


program New;
begin
repeat

GET http://google.com/ HTTP/1.1
Host: google.com
User-Agent: Mozilla/5.0 Gecko/20061010 Firefox/2.0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: da,en-us;q=0.7,en;q=0.3
Accept-Charset: ISO-8859
Keep-Alive: 300
Proxy-Connection: keep-alive
Cookie: cookie here
Content-length: 0

until 1>2
end.


Need help please :)

/ Rune

botmaster

2007-05-14 16:19:16

Yes. OpenConnection() and SendSocket().

Rune

2007-05-15 11:52:37

I will try to get it to work, thx.

Spky

2007-05-15 13:28:44

For your example:


var
Connection : Integer;
ConData : string;

begin
Connection:= OpenConnection('google.com', 80, 1000);
SendConnectionData(Connection, 'GET http://www.google.com/ HTTP/1.1'#13#10#13#10);
ReadConnectionData(Connection, ConData)
FreeConnection(Connection);
Writeln(ConData);
end.

Jason2gs

2007-05-17 18:53:48

From: Spky
For your example:


var
Connection : Integer;
ConData : string;

begin
Connection:= OpenConnection('google.com', 80, 1000);
SendConnectionData(Connection, 'GET http://www.google.com/ HTTP/1.1'#13#10#13#10);
ReadConnectionData(Connection, ConData)
FreeConnection(Connection);
Writeln(ConData);
end.


This kind of ties in with my question.

How would you use something like this to send a POST request to a website?