Even with current temporary IO support, you can still retrieve HTTP headers and cookies:
red>> data: read/info http://microsoft.com == [200 #( Cache-Control: "no-cache, no-store" Connection: "keep-alive" Date: "Wed,... red>> list: data/2/set-cookie == [{MS-CV=z/YnyU+5wE2gT8S1.1; domain=.microsoft.com; expires=Thu, 24-Mar-2016 10:59:39 GMT; pa... red>> foreach str list [probe parse str [collect [keep to "=" skip keep to [";" | end]]]] ["MS-CV" "z/YnyU+5wE2gT8S1.1"] ["MS-CV" "z/YnyU+5wE2gT8S1.2"]
HTTP headers are stored on the card !, so if multiple Set-Cookie
headers are sent, you will get a block of strings, otherwise just a string for the Set-Cookie
key.
read/info
will return a block with three elements:
- HTTP return code (integer!)
- HTTP headers (map!)
- requested data (string! or binary!)
Notes:
- HTTPS is supported by
read
and write
. - The best place to get information about red is to join the chat chat on Gitter .; -)
source share