cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Line termination differences in header vs. HTML

From: Michael T. Davis <DAVISM_at_ecr6.ohio-state.edu>
Date: Tue, 20 Mar 2007 19:34:39 -0400 (EDT)

At 19:23:46.12 on 20-MAR-2007 in message
<20070320232305.C657EB3E37_at_john.meissen.org>, you wrote:

>According to the HTTP specification (RFC2616), headers are terminated
>with CR-LF. The body content (the HTML) is not covered by the HTTP
>protocol specification.

        OK, I guess that explains the behavior, then. Thanks for the quick
response.

>
>john-
>
>
>
>> $ curl -V
>>
>> curl 7.14.0 (ALPHA-HP-VMS) libcurl/7.14.0 OpenSSL/0.9.7e
>> Protocols: ftp gopher telnet dict http file https ftps
>> Features: NTLM SSL
>>
>> ...running on an AlphaServer DS15 running OpenVMS V8.2
>>
>> I have pieced together a few DCL command procedures that utilize
>> cURL, and I have observed that when I specify "-i" and direct output to a
>> file, the header has different line termination characteristics than the
>> HTML content. In particular, I have to use something like this to properly
>> read the file:
>>
>> $ cr[ 0, 8 ] = 13
>> $ open/read in data.txt
>> $loop: read/end_of_file=end in record
>> $ ! header records have a carriage-return appended, so strip it (if
> necessary)
>> $ record = f$element ( 0, cr, record )
>> $ ! do whatever with record, now
>> $ goto loop
>> $end: close in
>>
>> Is this expected behavior, or a bug which is fixed with a newer version?
>>[...]

Regards,
Mike

-- 
         Michael T. Davis  (Mike)        |    Systems Specialist: CBE,MSE
    E-mail: davism_at_ecr6.ohio-state.edu   | Departmental Networking/Computing
           -or- DAVISM+@osu.edu          |     The Ohio State University
 http://www.ecr6.ohio-state.edu/~davism/ |     197 Watts, (614) 292-6928
Received on 2007-03-21