Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8581633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:06:01+00:00 2026-06-11T21:06:01+00:00

From the source code of net/http. The definition of http.Header is map[string][]string . Right?

  • 0

From the source code of net/http. The definition of http.Header is map[string][]string. Right?

But why go run below code, I get the result:

0

2

func main() {
    var header = make(http.Header)
    header.Add("hello", "world")
    header.Add("hello", "anotherworld")
    var t = []string {"a", "b"}
    fmt.Printf("%d\n", len(header["hello"]))
    fmt.Print(len(t))
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:06:02+00:00Added an answer on June 11, 2026 at 9:06 pm

    if you try

    fmt.Println(header)
    

    you’ll notice that the key has been capitalized. This is actually noted in the documentation of net/http.

    // HTTP defines that header names are case-insensitive.
    // The request parser implements this by canonicalizing the
    // name, making the first character and any characters
    // following a hyphen uppercase and the rest lowercase.
    

    This can be found in the comment on the field Header of type Request.

    http://golang.org/pkg/net/http/#Request

    Comment should probably be moved though..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I loaded up the .net 3.5 FastMember from http://code.google.com/p/fast-member/source/checkout in VS 2010. The compiler
I am new to orchard CMS. I have downloaded the source code from http://orchardproject.net/
I'm trying to compile SQLCipher. I've downloaded source code from http://sqlcipher.net/ . Then I'm
I downloaded the source code from http://construct.svn.sourceforge.net/viewvc/construct/ using tar ball http://construct.svn.sourceforge.net/viewvc/construct/?view=tar There is a
I got the source code from here http://weblogs.asp.net/scottgu/archive/2006/04/13/442772.aspx is it compatible with latest ASP.net
I am trying to install boto from the source code / pypi, but I
This is heavily trimmed down source code from a webpage I'm working on right
Introduction After watching this video from LIDNUG, about .NET code protection http://secureteam.net/lidnug_recording/Untitled.swf (especially from
I use in my project ASP.NET assemblies building from source code. My project builded
Source code at: http://jsfiddle.net/lski/4aTm5/ I have succeeded in getting the above code in Firefox,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.