I am currently using curl
to send an HTTPS request to an API. The request is of the following format:
curl -k -X POST \
-H "Authorization: OAuth2 $API_TOKEN" \
--data-urlencode container_request@/dev/stdin \
https://$API_HOST/container_requests/ \
<<EOF
{
"container_image":"x3dm2-4zz18-59mq7hyzbu1rglu",
// options
"command":[
"cwl-runner"
// more options
]
}
EOF
The 2 options I have thought of are:
- executing
curl
withRuntime.getRuntime().exec(...)
- constructing an HTTPS request
However, I can't get my head around how I could add the JSON input.