From f27e57f1b73ff895032db0722a92d36c6d6d58ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Mon, 14 Mar 2022 19:06:57 +0100 Subject: [PATCH] switch request to post --- ch14.jl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ch14.jl b/ch14.jl index 4c49154..910fd81 100644 --- a/ch14.jl +++ b/ch14.jl @@ -106,22 +106,22 @@ Genie.Renderer.Json.json((firstname="Bogumił", lastname="Kamiński")) using HTTP using JSON3 -req = HTTP.request("POST", "http://127.0.0.1:8000", - ["Content-Type" => "application/json"], - JSON3.write((K=55.0, max_time=0.25))) +req = HTTP.post("http://127.0.0.1:8000", + ["Content-Type" => "application/json"], + JSON3.write((K=55.0, max_time=0.25))) JSON3.read(req.body) -HTTP.request("POST", "http://127.0.0.1:8000", - ["Content-Type" => "application/json"], - JSON3.write((K="", max_time=0.25))) +HTTP.post("http://127.0.0.1:8000", + ["Content-Type" => "application/json"], + JSON3.write((K="", max_time=0.25))) using DataFrames df = DataFrame(K=30:2:80, max_time=0.25) df.data = map(df.K, df.max_time) do K, max_time @show K - @time req = HTTP.request("POST", "http://127.0.0.1:8000", - ["Content-Type" => "application/json"], - JSON3.write((;K, max_time))) + @time req = HTTP.post("http://127.0.0.1:8000", + ["Content-Type" => "application/json"], + JSON3.write((;K, max_time))) return JSON3.read(req.body) end;