shrub/lib/http.hoon

34 lines
716 B
Plaintext
Raw Normal View History

2015-05-07 00:00:06 +03:00
::
2015-12-20 14:48:17 +03:00
:::: /hoon#http#lib
2015-05-07 00:00:06 +03:00
::
::
::
/? 310
!:
|%
2015-09-02 01:20:17 +03:00
++ request
2015-12-20 23:50:45 +03:00
$: domain/(list cord)
end-point/path
req-type/$?($get {$post p/json})
headers/math
queries/quay
2015-09-02 01:20:17 +03:00
==
++ send
2015-12-20 23:50:45 +03:00
|= {ost/bone pour-path/wire params/request}
2015-09-02 01:20:17 +03:00
:^ ost %them pour-path
`(unit hiss)`[~ (request-to-hiss params)]
2015-05-29 02:07:03 +03:00
::
2015-09-02 01:20:17 +03:00
++ request-to-hiss
|= request ^- hiss
=- ~& hiss=- -
2015-12-20 23:50:45 +03:00
:- ^- parsed-url/purl
2015-09-02 01:20:17 +03:00
:+ :+ security=%.y
port=~
host=[%.y [path=domain]]
endpoint=[extensions=~ point=end-point] :: ++pork,
q-strings=queries :: ++quay
?@ req-type
[%get headers ~]
[%post headers ~ (tact (pojo p.req-type))]
2015-05-07 00:00:06 +03:00
--