Has Microsoft created a class full of constants for the standard HTTP header names or will I have to write my own?
To expand on Jed's answer.
The HttpResponseHeader and HttpRequestHeader enumerations can be used as your constants when using the WebHeaderCollection. WebHeaderCollection
contains indexer properties that accept these enumerations.
You can use either a string or one of the enumerations to get and set the header value, and mix it up as well within you code.
Example LinqPad script:
var headers = new WebHeaderCollection();
headers["If-Modified-Since"] = "Sat, 29 Oct 1994 19:43:31 GMT";
// shows header name as "If-Modified-Since"
headers.Dump();
// shows expected header value of "Sat, 29 Oct 1994 19:43:31 GMT"
headers[HttpRequestHeader.IfModifiedSince].Dump();
headers.Clear();
headers[HttpRequestHeader.IfModifiedSince] = "Sat, 29 Oct 1994 19:43:31 GMT";
// shows header name as "If-Modified-Since"
headers.Dump();
// shows expected header value "Sat, 29 Oct 1994 19:43:31 GMT"
headers["If-Modified-Since"].Dump();