1

Sending a JSON to local service, but it does not receive it, why?

let config = try Config()
try config.setup()

let drop = try Droplet(config)
try drop.setup()

drop.get(handler: {req in

    if req.json != nil {

        print("ass")
        print(req.json!)
    }

    return "almaG"
})

enter image description here

enter image description here

János
  • 32,867
  • 38
  • 193
  • 353

1 Answers1

2

You're sending a GET request with a body. Try sending a POST instead and use drop.post().