Use cURL

The examples within this document use cURL to demonstrate how to access the Oracle Access Governance. REST API.

Task 1: Install cURL

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

To connect securely to the server, you must install a version of cURL that supports SSL and provide an SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate.

Install cURL on Your System

To install cURL on your system:
  1. Check if cURL is pre-installed. Open the terminal and type curl --version. If it displays the version details, cURL is already installed.
  2. In your browser, navigate to the cURL home page at http://curl.haxx.se, and then click Download in the left navigation menu.
  3. On the cURL Releases and Downloads page, locate the SSL-enabled version of the cURL software that corresponds to your operating system, and then click the link to download the ZIP file.
  4. Install the software.
  5. Navigate to the cURL CA Certs page at http://curl.haxx.se/docs/caextract.html, and then download the ca-bundle.crt SSL certificate authority (CA) certificate bundle into the folder where you installed cURL.
  6. Set the cURL environment variable:
    1. Open a command window
    2. Navigate to the directory where you installed cURL.
    3. Set the cURL environment variable (CURL_CA_BUNDLE) to the SSL CA certificate bundle location. For example:
      C:\curl> set CURL_CA_BUNDLE=ca-bundle.crt

    Note:

    If you are using MacOS or other linux-based operating system, use the backslash (\) for multi-line commands. For Windows, use the caret (^) for multi-line commands in the Command Prompt.

Task 3: Invoke cURL

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

Specifies the request body, or data, either directly or by referring to a JSON file on the local machine.

-F, --form @file.json

Specifies form data, either directly or by referring to a JSON file on the local machine.

-H, --header

Defines a request header.

-i

Displays response header information.

-u, --user

Specifies the user name and password for the Oracle Access Governance account.

-X

Indicates the type of request (for example, GET, POST, and so on).