switch request to post

This commit is contained in:
Bogumił Kamiński 2022-03-14 19:06:57 +01:00
parent 649c118b40
commit f27e57f1b7

View File

@ -106,12 +106,12 @@ Genie.Renderer.Json.json((firstname="Bogumił", lastname="Kamiński"))
using HTTP using HTTP
using JSON3 using JSON3
req = HTTP.request("POST", "http://127.0.0.1:8000", req = HTTP.post("http://127.0.0.1:8000",
["Content-Type" => "application/json"], ["Content-Type" => "application/json"],
JSON3.write((K=55.0, max_time=0.25))) JSON3.write((K=55.0, max_time=0.25)))
JSON3.read(req.body) JSON3.read(req.body)
HTTP.request("POST", "http://127.0.0.1:8000", HTTP.post("http://127.0.0.1:8000",
["Content-Type" => "application/json"], ["Content-Type" => "application/json"],
JSON3.write((K="", max_time=0.25))) JSON3.write((K="", max_time=0.25)))
@ -119,7 +119,7 @@ using DataFrames
df = DataFrame(K=30:2:80, max_time=0.25) df = DataFrame(K=30:2:80, max_time=0.25)
df.data = map(df.K, df.max_time) do K, max_time df.data = map(df.K, df.max_time) do K, max_time
@show K @show K
@time req = HTTP.request("POST", "http://127.0.0.1:8000", @time req = HTTP.post("http://127.0.0.1:8000",
["Content-Type" => "application/json"], ["Content-Type" => "application/json"],
JSON3.write((;K, max_time))) JSON3.write((;K, max_time)))
return JSON3.read(req.body) return JSON3.read(req.body)