Create user from teamcity rest API

641 Views Asked by At

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?

1

There are 1 best solutions below

0
P Pang On BEST ANSWER

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.