8000
Hi! How are you? I am facing the following issue. Suppouse that you have and enpoint that returns a JSON
using Bukdu struct WelcomeController <: ApplicationController conn::Conn end index(c::WelcomeController) = render(JSON, Dict("something"=>[:hello_world, :goodbye_world])) routes() do get("/", WelcomeController, index) end Bukdu.start(8080)
If I made a call from a browser to "/" I got:
"/"
{"something":["hello_world","goodbye_world"]}
But when I made a test case and I call the endpoing from julia doing: julia> response = Bukdu.Router.call(get, "/")
julia> response = Bukdu.Router.call(get, "/")
I got:
julia> response.got Dict{String,Array{Symbol,1}} with 1 entry: "something" => Symbol[:hello_world, :goodbye_world]
Is this an expected behaviour?
yes, that's expected. if you want to take the result that like browser, use resp.body.
resp.body
julia> String(response.resp.body) "{\"something\":[\"hello_world\",\"goodbye_world\"]}"
Thank you!
Activity
wookay commentedon Apr 3, 2020
yes, that's expected. if you want to take the result that like browser, use
resp.body.lucianolorenti commentedon Apr 3, 2020
Thank you!