>________________________________
> From: silvioprog <[email protected]>
>To: FPC-Pascal users discussions <[email protected]>
>Sent: Friday, November 23, 2012 2:38 PM
>Subject: Re: [fpc-pascal] A simple HTTP request with FPC standard units
>
>
>Done:
>
>
>http://bugs.freepascal.org/view.php?id=23372
>
>
>
>
>2012/11/23 silvioprog <[email protected]>
>
>I solved the error. In:
>>
>>
>>fphttpclient.pas:line285
>>
>>Function TFPCustomHTTPClient.GetServerURL(URI : TURI) : String;
>>
>>
>>Var
>> D : String;
>>
>>
>>begin
>> D:=URI.Path;
>> If (D[1]<>'/') then
>> D:='/'+D;
>> If (D[Length(D)]<>'/') then
>> D:=D+'/';
>> Result:=D+URI.Document;
>> if (URI.Params<>'') then
>> Result:=Result+'?'+URI.Params;
>>end;
>>
>>
The code needed to execute the function could be even smaller if this is
changed to a class function. Instead of needing to create an instance, then
using, then freeing, the whole thing could something like this:
...
begin
s := TFPCustomHTTPClient.GetServerURL('http://a_site/a_page');
writeln(s);
end;
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal