[Lazarus] lnet and http headers
Krzysztof
dibo20 at wp.pl
Wed Jul 6 12:36:13 CEST 2011
Hi,
I am using synapse on 32 and 64 bit Windows and Linux without problems. Can
you publish some code here?
About lNET: They are very good sockets (non blocking mode is strong point
for me), but they are too much "typed". If you want serve non standard
status codes or headers, you must add it manually to the source (lhttp.pp
unit) and recompile package. That's why I returned to synapse. But to answer
for your question:
1. If you want read some header, you must add OnProcessHeaders event:
procedure TForm1.LHTTPClientComponent1ProcessHeaders(ASocket:
TLHTTPClientSocket);
begin
Memo1.Append(ASocket.Parameters[hpContentLength]);
end;
2. If you want add header, you must call
LHTTPClient1.AddExtraHeader('Content-length: 123');
Notify that there is no way to clear this headers (if you want call next
request on this same http client but with different headers). So I wrote
patch for this, but not accepted yet:
http://bugs.freepascal.org/view.php?id=18954
Regards
2011/7/6 ik <idokan at gmail.com>
>
> On Wed, Jul 6, 2011 at 12:09, ADTEC (Pty) Ltd <adtec at adtec.co.za> wrote:
>
>> Hi
>>
>
> Hi,
>
>
>>
>> I'm currently using synapse to connect to a website that will send a
>> redirect instruction in one of the http headers. Unfortunately, I
>> can't get it to work in 64bit. I'm trying to convert to the lnet
>> package but can't see how to access the headers. Does anyone know if
>> the package is capable of returning individual headers? If so, do you
>> have an example I can view?
>>
>
>
> https://github.com/ik5/xmlrpc-client-ui/blob/master/src/untxmlrpc_client.pp#L347
>
> But why not to publish the problematic code so we can help you better ?
>
>
>>
>> Thanks
>>
>> Graham
>>
>
> Ido
>
>
>>
>> --
>> _______________________________________________
>> Lazarus mailing list
>> Lazarus at lists.lazarus.freepascal.org
>> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110706/d59f742e/attachment-0003.html>
More information about the Lazarus
mailing list