switch request to post
This commit is contained in:
parent
649c118b40
commit
f27e57f1b7
6
ch14.jl
6
ch14.jl
@ -106,12 +106,12 @@ Genie.Renderer.Json.json((firstname="Bogumił", lastname="Kamiński"))
|
||||
|
||||
using HTTP
|
||||
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"],
|
||||
JSON3.write((K=55.0, max_time=0.25)))
|
||||
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"],
|
||||
JSON3.write((K="", max_time=0.25)))
|
||||
|
||||
@ -119,7 +119,7 @@ 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",
|
||||
@time req = HTTP.post("http://127.0.0.1:8000",
|
||||
["Content-Type" => "application/json"],
|
||||
JSON3.write((;K, max_time)))
|
||||
return JSON3.read(req.body)
|
||||
|
Loading…
Reference in New Issue
Block a user