2012/11/23 Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">
On Fri, 23 Nov 2012, luciano de souza wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hello listers,<br>
Using Synapse, the developer has very good features to deal with the<br>
HTTP protocol. But imagine you want only to do a "get" in a URL and<br>
take a string back. I imagine it can be done with the standard units<br>
of Freepascal. Is it true? How could I do it with FPC 2.7.1?<br>
</blockquote>
<br></div>
very simple:<br>
<br>
uses fphttpclient;<br>
<br>
Var<br>
S : String;<br>
<br>
begin<br>
With TFPHttpClient.Create(Nil) do<br>
try<br>
S:=Get(ParamStr(1));<br>
finally<br>
Free;<br>
end;<br>
Writeln('Got : ',S);<br>
end.<br>
<br>
<br>
home: >fpc -S2 th.pp<br>
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?<br>
home: >th <a href="http://www.freepascal.org/" target="_blank">http://www.freepascal.org/</a><br>
Got : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br>
<html><br>
<!-- Web Page Design by James Koster - <a href="http://www.jameskoster.co.uk" target="_blank">http://www.jameskoster.co.uk</a> and Marko Mihel?i? - <a href="http://www.mcville.net--" target="_blank">http://www.mcville.net--</a>><br>
<br>
<head><br>
<br>
I cut off the rest.<span class=""><font color="#888888"><br>
<br>
Michael.<br></font></span></blockquote></div><div class="gmail_extra"><br></div>Really TFPHttpClient is a pleasant class. Now I updated EasyRSS plugin for use it.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
Thank you again Michael! :)</div><div class="gmail_extra"><div><br></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a><br>
</div>