This shows you the differences between two versions of the page.
public:howto:httpgetpage [2007/11/30 14:30] 127.0.0.1 external edit |
public:howto:httpgetpage [2010/08/18 11:39] (current) frantic No need to create THTTPSend instansce, HttpGetText is function! |
||
---|---|---|---|
Line 20: | Line 20: | ||
sl := TStringList.Create; | sl := TStringList.Create; | ||
- | with THTTPSend.Create do | + | try |
- | begin | + | |
if HttpGetText('http://localhost/input.php?' + data,sl) then | if HttpGetText('http://localhost/input.php?' + data,sl) then | ||
- | try | + | WriteLn(sl.text) |
- | WriteLn(sl.text); | + | else |
- | except | + | |
WriteLn('Cannot get'); | WriteLn('Cannot get'); | ||
- | end; | + | finally |
sl.Free; | sl.Free; | ||
- | Free; | ||
end; | end; | ||
end. | end. | ||
</code> | </code> |