0

rest api stated this command as to create user

curl -uadmin:admin -X POST 172.31.68.145:8111/app/rest/users

but it gives user list any suggestion how to create user?

Ahsan Naseem
  • 1,046
  • 1
  • 19
  • 38

1 Answers1

2

It is because you have not specified any post data for the request.

Let us take an example:

curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:9090/api/login

This will perform a POST request on http://localhost:9090/api/login with the POST data: {"username":"xyz","password":"xyz"} and header for this data is set to: Content-Type: application/json.

P Pang
  • 254
  • 3
  • 15