urbit/base/lib/http/core.hook
2015-05-06 14:08:27 -07:00

30 lines
771 B
Plaintext

::
:::: /hook/core/sole/lib;
::
::
::
/? 310
!:
|%
++ httpreq
|= $: ost=bone pour-path=wire
domain=(list cord) end-point=path
req-type=$?(%get [%post json]) headers=math
queries=quay
==
=+ ^- parsed-url=purl
:+ :+ security=%.y
port=~
host=[%.y [path=domain]]
endpoint=[extensions=~ point=end-point] :: ++pork,
q-strings=queries :: ++quay
=+ ^- request=hiss :: cast to hiss
:- parsed-url
?@ req-type
[%get headers ~]
[%post headers ~ (tact (pojo +.req-type))]
:^ ost %pass pour-path
:+ %e %them
`(unit hiss)`[~ request]
--