cURL Access

The cURL command-line tool can be used to make REST API calls. The following login example shows the input and output of the user.xml file:

curl -v -c sessionid.txt -X POST -d@user.xml -H"Content-Type: application/
xml" -H"Accept: application/xml" http://localhost:8080/rest/v1.0/admin/login
<?xml version="1.0" encoding="UTF-8"?>
<session>
<userName>admin</userName>
<password>admin</password>
</session>

You can specify one or more of the cURL command-line options defined in the following table, as required, to direct its execution:

cURL Option Description
-d, --data @file.json Identifies the request document, in JSON format, on the local machine.
-F, --form @file.json Identifies form data, in JSON format, on the local machine.
-H Defines one or both of the following:
  • Content type of the request document

  • Custom header, X-ID-TENANT-NAME, to identify the identity domain

-i Displays response header information.
-u, --user username:password Specifies the user name and password for the <ProductName> account.
-X Indicates the type of request (for example, GET, POST, and so on).