Use cURL

cURL is an open source, command-line tool for transferring data to URLs, and supports various protocols including HTTP and HTTPS.

The examples in this guide use the cURL tool to demonstrate how to access the Oracle Cloud Stack REST API. See Install cURL.

Invoke cURL and specify one or more of the command-line options to direct its execution.

cURL Option Description

-d value

-d @file

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

-F name=value

-F name=@file

Specifies the request body as a collection of form parameters. Define each parameter with a name and value, either directly or by referring to a file on the local machine.

-H name:value

Defines a request header.

-i

Displays response header information.

-u username:password

Specifies the user name and password for HTTP authentication.

-X method

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

-x protocol://host:port

Connect to Oracle Cloud through a proxy server.

Alternatively, set the HTTP_PROXY or HTTPS_PROXY environment variables prior to running cURL.