Use cURL

cURL is an open source, command-line tool for transferring data with URL syntax. To connect securely to the server, you must install a version of cURL that supports SSL.

Invoke cURL and specify one or more of the 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. Also passes parameters for creating or updating a cache.
-H Defines one or all of the following:
  • Content type of the request document

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

  • The Authorization header with the user name and password for the account, for example, Authorization:joe@example.com:myPassword.

-i Displays response header information.
-o path Identifies the response output on the local machine. Use this option to save the output to a file.
-u, --user username:password Specifies the user name and password for the account as an alternative to the Authorization header.
-X Indicates the type of request (for example, GET, POST, and so on). The default is GET.

The following example shows how to view the details of a cache by submitting a GET request on the REST resource using cURL:

curl -i -X GET -u joe@example.com:joePassword \
 -H "X-ID-TENANT-NAME:ExampleIdentityDomain" \
  https://apaas.us.oraclecloud.com/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/caching/instances/MyCache