Use cURL

cURL is an open source, command-line tool for transferring data with URL syntax, supporting various protocols including HTTP and HTTPS.

To use cURL to access the REST API:

  • Install cURL, as described in Quick Start.

  • 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.
    -H Defines the Content type of the request document.
    -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).
    -k By default, every SSL connection curl makes is verified to be secure. This option allows cURL to proceed and operate even for server connections otherwise considered insecure.
    -capath Indicates to cURL to use the specified certificate directory to verify the peer.

The sample files can help in creating an application that requires managing the Oracle Database Appliance using Java as a language. The sample files use DCSAgentClient API class to manage database related life cycle operations such as listDatabases, createDatabase, updateDatabase, ObjectStoreSwift operations and many more. The following are representative samples of the REST APIs.

The following is an example syntax for cURL command:

curl -i -X GET -u <username>:<password> -H <request-header>:<value> https://<subdomain>.<domain>.com/<path>/<resource-path>