Refefer
Refefer

Reputation: 551

Why is the Accept header prefixed with HTTP_?

I've noticed that it's almost an universal convention to prefix Http headers with HTTP_ when accessing them from a web server. Can anyone explain to me the circumstances about how this came about?

Upvotes: 2

Views: 848

Answers (1)

Laurence Gonsalves
Laurence Gonsalves

Reputation: 143104

It sounds like you're talking about CGI scripts. The HTTP headers are passed as environment variables. As there may be other environment variables that have nothing to do with HTTP (eg: PATH), it makes sense to tack on a common prefix to reduce the chance of collisions.

Upvotes: 3

Related Questions