provide helper function to get http headers
Closed / Fixed2927221fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 4 years ago
Descriptionplain2010-01-06 22:44:10
The http package puts the response headers into the meta element of the state array exactly as they are received from the server. If a program needs to get a specific well-known header (i.e., Location) they must search the meta array in a case-insensitive manner rather than just accessing the keys. The requested feature is to provide a case-insensitive lookup into the meta array, either through a new helper function (::http::header) or by having http::meta take an optional key argument to return only the requested key instead of the entire array. (::http::meta token ?key?)
ferrieuxplain2010-01-07 16:29:47
A new helper function ::http::header would indeed be the simplest, returning basically the same key-value list (isomorphous to a dict BTW) as ::meta but with [string tolower] applied to the keys.
kjnashplain2022-09-10 11:57:24
Fixed in commit [31732edc8a], branch http-bugfixes-2022H2. N.B. the list of header names and values is not a dict because the same header name can be sent more than once.
Log in (anonymous is fine) to add a comment.