aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/world/net/http/request.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/world/net/http/request.lux78
1 files changed, 39 insertions, 39 deletions
diff --git a/stdlib/source/library/lux/world/net/http/request.lux b/stdlib/source/library/lux/world/net/http/request.lux
index 6bc72ff50..a7a29eaca 100644
--- a/stdlib/source/library/lux/world/net/http/request.lux
+++ b/stdlib/source/library/lux/world/net/http/request.lux
@@ -1,33 +1,33 @@
(.using
- [library
- [lux "*"
- [control
- pipe
- ["[0]" monad {"+" do}]
- ["[0]" maybe]
- ["[0]" try {"+" Try}]
- [concurrency
- ["[0]" async {"+" Async}]
- ["[0]" frp]]
- [parser
- ["<[0]>" json]]]
- [data
- ["[0]" number
- ["n" nat]]
- ["[0]" text
- ["[0]" encoding]]
- [format
- ["[0]" json {"+" JSON}]
- ["[0]" context {"+" Context Property}]]
- [collection
- ["[0]" list ("[1]#[0]" functor mix)]
- ["[0]" dictionary]]]
- [world
- ["[0]" binary {"+" Binary}]]]]
- ["[0]" // {"+" Body Response Server}
- ["[1][0]" response]
- ["[1][0]" query]
- ["[1][0]" cookie]])
+ [library
+ [lux "*"
+ [control
+ pipe
+ ["[0]" monad {"+" do}]
+ ["[0]" maybe]
+ ["[0]" try {"+" Try}]
+ [concurrency
+ ["[0]" async {"+" Async}]
+ ["[0]" frp]]
+ [parser
+ ["<[0]>" json]]]
+ [data
+ ["[0]" number
+ ["n" nat]]
+ ["[0]" text
+ ["[0]" encoding]]
+ [format
+ ["[0]" json {"+" JSON}]
+ ["[0]" context {"+" Context Property}]]
+ [collection
+ ["[0]" list ("[1]#[0]" functor mix)]
+ ["[0]" dictionary]]]
+ [world
+ ["[0]" binary {"+" Binary}]]]]
+ ["[0]" // {"+" Body Response Server}
+ ["[1][0]" response]
+ ["[1][0]" query]
+ ["[1][0]" cookie]])
(def: (merge inputs)
(-> (List Binary) Binary)
@@ -54,9 +54,9 @@
(def: .public (json reader server)
(All (_ a) (-> (<json>.Reader a) (-> a Server) Server))
- (function (_ (^@ request [identification protocol resource message]))
+ (function (_ (^let request [identification protocol resource message]))
(do async.monad
- [?raw (read_text_body (value@ //.#body message))]
+ [?raw (read_text_body (the //.#body message))]
(case (do try.monad
[raw ?raw
content (# json.codec decoded raw)]
@@ -69,9 +69,9 @@
(def: .public (text server)
(-> (-> Text Server) Server)
- (function (_ (^@ request [identification protocol resource message]))
+ (function (_ (^let request [identification protocol resource message]))
(do async.monad
- [?raw (read_text_body (value@ //.#body message))]
+ [?raw (read_text_body (the //.#body message))]
(case ?raw
{try.#Success content}
(server content request)
@@ -82,14 +82,14 @@
(def: .public (query property server)
(All (_ a) (-> (Property a) (-> a Server) Server))
(function (_ [identification protocol resource message])
- (let [full (value@ //.#uri resource)
+ (let [full (the //.#uri resource)
[uri query] (|> full
(text.split_by "?")
(maybe.else [full ""]))]
(case (do try.monad
[query (//query.parameters query)
input (context.result query property)]
- (in [[identification protocol (with@ //.#uri uri resource) message]
+ (in [[identification protocol (has //.#uri uri resource) message]
input]))
{try.#Success [request input]}
(server input request)
@@ -99,9 +99,9 @@
(def: .public (form property server)
(All (_ a) (-> (Property a) (-> a Server) Server))
- (function (_ (^@ request [identification protocol resource message]))
+ (function (_ (^let request [identification protocol resource message]))
(do async.monad
- [?body (read_text_body (value@ //.#body message))]
+ [?body (read_text_body (the //.#body message))]
(case (do try.monad
[body ?body
form (//query.parameters body)]
@@ -114,9 +114,9 @@
(def: .public (cookies property server)
(All (_ a) (-> (Property a) (-> a Server) Server))
- (function (_ (^@ request [identification protocol resource message]))
+ (function (_ (^let request [identification protocol resource message]))
(case (do try.monad
- [cookies (|> (value@ //.#headers message)
+ [cookies (|> (the //.#headers message)
(dictionary.value "Cookie")
(maybe.else "")
//cookie.get)]