jonataslaw / dart-server-nano

A light, fast, and friendly server written in Dart.
MIT License
23 stars 4 forks source link

POST example #19

Closed pierre-kci closed 1 month ago

pierre-kci commented 1 month ago

Hi,

Could you please show how to set-up a POST ? Below yields no result, I am missing something ?

  server.post('/usercreate', (req, res) async {
    print('${req.query}');
    res.send('Hello User! ${req.query['key1']}');
  });
  curl http://localhost:3000/usercreate --header 'Content-Type: application/json' --data '{"key1": "gg"}'
pierre-kci commented 1 month ago

just use Git bash instead of the dreadful windows terminal/powershell