mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 16:09:31 +03:00
36 lines
782 B
Plaintext
36 lines
782 B
Plaintext
::
|
|
:::: /hoon/http/lib
|
|
::
|
|
::
|
|
::
|
|
/? 310
|
|
::
|
|
=, mimes:html
|
|
=, html
|
|
|%
|
|
++ request
|
|
$: domain/(list cord)
|
|
end-point/path
|
|
req-type/$?($get {$post p/json})
|
|
headers/math:eyre
|
|
queries/quay:eyre
|
|
==
|
|
++ send
|
|
|= {ost/bone pour-path/wire params/request}
|
|
:^ ost %them pour-path
|
|
`(unit hiss:eyre)`[~ (request-to-hiss params)]
|
|
::
|
|
++ request-to-hiss
|
|
|= request ^- hiss:eyre
|
|
=- ~& hiss=- -
|
|
:- ^- parsed-url/purl:eyre
|
|
:+ :+ security=%.y
|
|
port=~
|
|
host=[%.y [path=domain]]
|
|
endpoint=[extensions=~ point=end-point] :: ++pork,
|
|
q-strings=queries :: ++quay
|
|
?@ req-type
|
|
[%get headers ~]
|
|
[%post headers ~ (as-octt:mimes:html (en-json p.req-type))]
|
|
--
|