cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Line termination differences in header vs. HTML

From: John Meissen <john_at_meissen.org>
Date: Tue, 20 Mar 2007 16:23:05 -0700

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.

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?
>
> Thanks,
> Mike
> --
> | Systems Specialist: CBE,MSE
> Michael T. Davis (Mike) | Departmental Networking/Computing
> http://www.ecr6.ohio-state.edu/~davism/ | The Ohio State University
> | 197 Watts, (614) 292-6928
Received on 2007-03-21