Open devnacho opened 5 years ago
~~because the conn.params
is a type of Assoc
sometimes it's useful with undefined names like~~
@info :payload (c.params.message, c.params.x, c.params.y)
if you want to decode the request body directly, try this way
using JSON2
function create(c::RESTController)
json = JSON2.read(IOBuffer(c.conn.request.body))
@info :json json
end
in Bukdu v0.4.2, you could plug(Plug.Parsers, :json => Plug.ContentParsers.JSONDecoder, parsers=[:json])
see https://github.com/wookay/Bukdu.jl/blob/v0.4.2/examples/rest/ex3.jl
Hi @wookay,
I've updated to 0.4.1 but when receiving a JSON payload, it seems like the payload is not being parsed correctly. I followed this example https://github.com/wookay/Bukdu.jl/blob/master/examples/rest/ex2.jl
The JSON payload is something like this:
and it is being parsed to this type
Instead of something like:
Is there any reason why it might happen this?