urbit/base/lib/http/core.hook
Anton Dyudin a8578d4ed2 port1
2015-05-13 12:46:25 -07:00

29 lines
753 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 %them pour-path
`(unit hiss)`[~ request]
--