Http header and CR LF

48 views
Skip to first unread message

Tong Sun

unread,
May 29, 2019, 11:43:56 AM5/29/19
to golang-nuts
A question related to Go as "\n" in Go does not mean CR LF -- 

Is http header requires CR LF as line end? 
Perl can handle "\n" automatically for CR LF, but I saw a Perl program ends each http header specifically with CR LF. 

Shall I care about doing the same thing for my Go http handling? 


Philip Chapman

unread,
May 29, 2019, 11:51:59 AM5/29/19
to Tong Sun, golang-nuts
This is not a golang question per-se, but a question about HTTP headers.  My suggestion is to read up on HTTP headers and their requirements here:


And concerning inserting an actual carriage return followed by a line feed, you can see how to do that here (hint, know your ASCII characters):


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e3ea401d-d40a-4535-8d8c-bec9c539a1c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Philip A. Chapman
Java Software Development
Enterprise, Web, and Desktop
Reply all
Reply to author
Forward
0 new messages