<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">Le 10/06/2013 21:49, Alejandro Gonzalo
a écrit :<br>
</div>
<blockquote
cite="mid:1370893786.23182.YahooMailNeo@web162005.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:times
new roman, new york, times, serif;font-size:12pt">
<div>Using fpc's cddb unit I was able to form the freedb query
string from the CD in my drive (for "The Great Bluesmen" it
was : 2b10b215 21 150 12557 26267 48645 60997 77047 91730
103462 117580 129470 145975 160670 185985 199220 213447 228725
250610 270005 283037 292752 309990 4276). Using the
instructions at </div>
<div><a moz-do-not-send="true"
href="http://staffwww.dcs.shef.ac.uk/people/D.Abbott/Library/freedb.howto1.06.txt">http://staffwww.dcs.shef.ac.uk/people/D.Abbott/Library/freedb.howto1.06.txt</a></div>
<div>I tried using the Get method of Indy's TIdHTTP component to
go retrieve the album info, but I just get error messages
(usually 500 Command syntax error: incorrect number of
arguments).</div>
<div> </div>
<div>Could some kind person please give me a successful example
of using TIdHttp.get (or the equivalent in Synapse) with
freedb.org? Are there Properties I need to set?</div>
<div> </div>
<div>Thank you.</div>
<div> </div>
<div>A. G.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
I've read in the howto that the GET is not supported and POST bust
be used instead. After having quickly read the text it seems that
the request is adressed to a form using fields descriptors. This
meand that the header must be filled in as the URL requests it. Y
guess you shoud use something like<br>
var<br>
data: TIdMultiPartFormDataStream;<br>
ResponseStream: TStringStream;<br>
Reponse: String;<br>
IdIntercept: TIdConnectionIntercept; // might not be needed<br>
<br>
begin<br>
... some initialization code<br>
<br>
IdIntercept := TIdConnectionIntercept.Create(nil); // might not
be needed<br>
data := TIdMultiPartFormDataStream.Create;<br>
with TIdHTTP.Create(nil) do try<br>
// use a timeout to get control back if URL does not answer<br>
ConnectTimeout := 20000;<br>
<br>
// might not be needed but usefull to trace what happens<br>
IdIntercept.OnConnect := @HttpInterceptConnect;<br>
IdIntercept.OnDisconnect := @HttpInterceptDisconnect;<br>
IdIntercept.OnReceive := @HttpInterceptReceive; // <---
this one could be important to use<br>
IdIntercept.OnSend := @HttpInterceptSend;<br>
<br>
// you maight use these event if you want to inform the use on
how things are going on<br>
OnStatus := IdHTTPSStatus;<br>
OnWork := IdHTTPSWork;<br>
OnWorkBegin := IdHTTPSWorkBegin;<br>
OnWorkEnd := IdHTTPSWorkEnd;<br>
<br>
Request.ContentLength := -1;<br>
Request.ContentRangeEnd := 0;<br>
Request.ContentRangeStart := 0;<br>
Request.Accept := 'text/html, */*';<br>
Request.BasicAuthentication := False;<br>
Request.UserAgent := 'Some identification(compatible; Indy
Library)';<br>
Request.Username := 'some_uer_if_needed';<br>
Request.Password := 'user_password?';<br>
HTTPOptions := [hoForceEncodeParams];<br>
Request.ContentType := 'application/x-www-form-urlencoded';<br>
data.AddFormField('no_client', AClient);<br>
<br>
... as many fields as needed<br>
<br>
Request.ContentLength := data.size;<br>
ResponseStream.Position := 0;<br>
Request.ContentLength := data.size;<br>
Post(HTTPPostServer, data, ResponseStream);<br>
ResponseStream.Position := 0;<br>
Reponse := ResponseStream.DataString;<br>
<br>
finally<br>
Free;<br>
data.Free;<br>
IdIntercept .Free<br>
end<br>
<br>
<blockquote
cite="mid:1370893786.23182.YahooMailNeo@web162005.mail.bf1.yahoo.com"
type="cite">
<pre wrap="">--
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
</blockquote>
<br>
</body>
</html>