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.jsonIdentifies the request document, in JSON format, on the local machine. -HDefines content type of the request document. -iDisplays response header information. -u, --user username:passwordSpecifies the user name and password for the Oracle Blockchain Platform account. Note that basic auth is not recommended. Use an OAuth 2.0 access token.
-XIndicates the type of request (for example, GET, POST, and so on). -vVerbose
For example:
curl -v -X POST \
"https://<rest_server_url:port>/api/v2/channels/default/chaincode-queries" \
-H "Authorization: Bearer <Token>" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
--data @<file.json with the request parameters>For a more detailed walkthrough of how to use cURL with an Oracle Cloud Infrastructure REST call, see https://www.ateam-oracle.com/post/oracle-cloud-infrastructure-oci-rest-call-walkthrough-with-curl.