.z.ph:f
Where f is a unary function, it is evaluated when a synchronous HTTP request is received by the kdb+
session.
.z.ph is passed a single argument, a 2-item list (requestText;requestHeaderAsDictionary):
requestText is parsed in .z.ph – detecting special cases like requests for CSV, XLS
output – and the result is returned to the calling task. Since V3.6 and V3.5 2019.11.13 .h.val is called instead of value, allowing
users to interpose their own valuation code.
requestHeaderAsDictionary contains information such as the user agent and can be used to return
content optimized for particular browsers.
q)\c 43 75
q).last.ph
| ::
when| 2007.08.16T12:20:32.681
u | `
w | 5
a | 2130706433
x | k){$[~#x:uh x:$[@x;x;*x];fram[$.z.f;x]("?";"?",*x:$."\\v");"?"=*x;..
y | (,"?";`Accept-Language`Accept-Encoding`Cookie`Referer`User-Agent`A..
r | "<html><head><style>a{text-decoration:none}a:link{color:024C7E}a:v..
q).last.ph.y
,"?"
`Accept-Language`Accept-Encoding`Cookie`Referer`User-Agent`Accept`Connec..
q).last.ph.y 0
,"?"
q).last.ph.y 1
Accept-Language| "en-us"
Accept-Encoding| "gzip, deflate"
Cookie | "defaultsymbol=AAPL"
Referer | "http://localhost:5001/"
User-Agent | "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) Appl..
Accept | "text/xml,application/xml,application/xhtml+xml,text/ht..
Connection | "keep-alive"
Host | "localhost:5001"