I’m trying to parse the headers in a response received by a Xojo.Net.HTTPSocket to a Dictionary. As far as I can see, the Xojo.Net.HTTPSocket only exposes one method related to the response headers - Xojo.Net.HTTPSocket.ResponseHeader(name As Text) As Text. This is fine if you know the name of a header (e.g: Content-Type) but is there a way to iterate through all of the response headers?
Looking at the ContentMemoryBlock property of the Xojo.Net.HTTPSocket instance after the page is received only seems to contain the body of the response, not the headers. The Xojo.Net.HTTPSocket.HeadersReceived event doesn’t expose them either.
Am I overlooking something here? Surely there must be a way to get a list of all response headers?
You’d think that such a simple and seemingly obvious feature wouldn’t be overlooked during implementation but it seems to be a common theme. It was requested 16 months ago, feedback://showreport?report_id=47895
It is easy to do that with the Classic Framework. I cannot comment for your case: I never used the New Framework.
You may start by getting the Header (put the Text in a TextArea) to know its format.
Imagine if the format is; one Header in a single line, and a space as Name / Property separator
Urgh. Just added to the Feedback case. How depressing.
[quote=404142:@Emile Schwarz]It is easy to do that with the Classic Framework. I cannot comment for your case: I never used the New Framework.
You may start by getting the Header (put the Text in a TextArea) to know its format.
Imagine if the format is; one Header in a single line, and a space as Name / Property separator
Just FYI that setting the connection type to TLSv12 does not mean you are using the HTTP 1.1 protocol on that connection.
With the classic HTTPSocket this simply means it connects using a newer security set up for the TCP/IP data transmission but is still using HTTP 1.0.