HTTPHeaders() Procedure
Posted: Mon Sep 04, 2023 4:55 pm
Hi,
Currently, if I want to parse HTTP headers from a request, I need to do a ton of (really ugly) string parsing. Like, to get Content-Disposition, I'd have to call HTTPInfo, then do a FindString for "Content-Disposition:", then extract the header value using Mid or StringField or some such method. It would be a lot easier if we had a function, something like hTTPHeaders, that returns us a map of header names and their values, basically in the same format that you can supply headers to HTTPRequest in.
Currently, if I want to parse HTTP headers from a request, I need to do a ton of (really ugly) string parsing. Like, to get Content-Disposition, I'd have to call HTTPInfo, then do a FindString for "Content-Disposition:", then extract the header value using Mid or StringField or some such method. It would be a lot easier if we had a function, something like hTTPHeaders, that returns us a map of header names and their values, basically in the same format that you can supply headers to HTTPRequest in.