I am trying to add a new domain in Jenkins Dashboard >Manage Jenkins>Credentials>System hitting the api using curl command
curl --verbose --location --connect-timeout 20 --max-time 60 --insecure --request POST /credentials/store/system/createDomain --user admin:admin --header 'Jenkins-Crumb:bddb81286103c6928c300daca54f302471799700b22009510366053ece7185dd' --header 'Cookie:JSESSIONID.108078a4=node01w6og5vjmmlg0e5lji5uz3fh544.node0' --header 'Content-Type: application/json' --data '{"name": "ndo", "description": "Domain for storing credentials"}'
But each time it throws the error
html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 400 Nothing is submitted</title>
</head>
<body><h2>HTTP ERROR 400 Nothing is submitted</h2>
<table>
<tr><th>URI:</th><td>/credentials/store/system/createDomain</td></tr>
<tr><th>STATUS:</th><td>400</td></tr>
<tr><th>MESSAGE:</th><td>Nothing is submitted</td></tr>
<tr><th>SERVLET:</th><td>Stapler</td></tr>
</table>
<hr/><a href=";>Powered by Jetty:// 10.0.18</a><hr/>
</body>
</html>
How to fix the error ? I have tried other options like
--data-urlencode json='{"parameter": [{"name":"test", "description":"Domain for storing credentials"}]}'
and --data-raw but got the same error