diff options
Diffstat (limited to 'stdlib/source/library/lux/world/net/http/client.lux')
-rw-r--r-- | stdlib/source/library/lux/world/net/http/client.lux | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/library/lux/world/net/http/client.lux b/stdlib/source/library/lux/world/net/http/client.lux index 8ba9a1694..827fd4c72 100644 --- a/stdlib/source/library/lux/world/net/http/client.lux +++ b/stdlib/source/library/lux/world/net/http/client.lux @@ -48,7 +48,7 @@ (All (_ !) (-> URL Headers (Maybe Binary) (Client !) (! (Try (Response !))))) - (at client request {<method>} url headers data)))] + (of client request {<method>} url headers data)))] [//.#Post] [//.#Get] @@ -140,7 +140,7 @@ (loop (again [so_far +0]) (do [! (try.with io.monad)] [.let [remaining (i.- so_far (.int buffer_size))] - bytes_read (at ! each (|>> ffi.of_int) + bytes_read (of ! each (|>> ffi.of_int) (java/io/BufferedInputStream::read buffer (ffi.as_int so_far) (ffi.as_int remaining) input))] (when bytes_read -1 (do ! @@ -151,10 +151,10 @@ (in [buffer_size buffer]) (again (i.+ bytes_read so_far)))))) (loop (again [so_far +0 - output (at binary.monoid identity)]) + output (of binary.monoid identity)]) (do [! (try.with io.monad)] [.let [remaining (i.- so_far (.int buffer_size))] - bytes_read (at ! each (|>> ffi.of_int) + bytes_read (of ! each (|>> ffi.of_int) (java/io/BufferedInputStream::read buffer (ffi.as_int so_far) (ffi.as_int remaining) input))] (when bytes_read -1 (do ! @@ -163,14 +163,14 @@ +0 (in (..body_of output)) _ (|> buffer (binary.slice 0 (.nat so_far)) - (at try.functor each - (|>> (at binary.monoid composite output) + (of try.functor each + (|>> (of binary.monoid composite output) ..body_of)) - (at io.monad in)))) + (of io.monad in)))) +0 (again so_far output) _ (if (i.= remaining bytes_read) (again +0 - (at binary.monoid composite output buffer)) + (of binary.monoid composite output buffer)) (again (i.+ bytes_read so_far) output)))))))))) @@ -218,7 +218,7 @@ headers (..default_headers connection) input (|> connection java/net/URLConnection::getInputStream - (at ! each (|>> java/io/BufferedInputStream::new)))] + (of ! each (|>> java/io/BufferedInputStream::new)))] (in [(.nat (ffi.of_int status)) [//.#headers headers //.#body (..default_body input)]])))))))] @@ -231,9 +231,9 @@ (Client Async)) (implementation (def (request method url headers data) - (|> (at client request method url headers data) + (|> (of client request method url headers data) async.future - (at async.monad each + (of async.monad each (|>> (pipe.when {try.#Success [status message]} {try.#Success [status (revised //.#body (is (-> (//.Body IO) (//.Body Async)) |