Rest api default settings

Hi,

I installed new project with REST API plugin.

Run application and try to make first connection.

MS DOS command line:
curl -X POST http://localhost:8080/oauth/token --basic --user client:secret -H ‘Content-Type: application/x-www-form-urlencoded’ -d ‘grant_type=password&username=admin&password=admin’

I got following error:
{“error”:“invalid_request”,“error_description”:“Missing grant type”}curl: (6) Could not resolve host: application
‘username’ is not recognized as an internal or external command,
operable program or batch file.
‘password’ is not recognized as an internal or external command,
operable program or batch file.

This is from documentation: Generic REST :: Jmix Documentation

What is a solution? What I did wrong?

Hi, Hajnal. Thank you for the report, actually, it works wrong for Windows cURL due to the wrong mark up in the example, also please pay attention to it when working with Windows cURL later on.
Has been created ticket in GitHub
To fix, your issue need to remove backslashes and change quotes from single to double
For example:
curl -X POST http://localhost:8080/oauth/token --basic --user client:secret -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=password&username=admin&password=admin"