cURL Access

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

To use cURL to access the Oracle Blockchain Platform 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.
    -H Defines content type of the request document.
    -i Displays response header information.
    -u, --user username:password Specifies the user name and password for the Oracle Blockchain Platform account.
    -X Indicates the type of request (for example, GET, POST, and so on).
    -v Verbose

For example:

curl -v -u <username>:<password> -X POST \
  "https://<rest_server_url:port>/api/v2/channels/default/chaincode-queries" \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  --data @<file.json with the request parameters>