curl - Cloud Foundry CLI Reference Guide


curl - Executes a request to the targeted API endpoint


cf curl PATH [-iv] [-X METHOD] [-H HEADER]... [-d DATA] [--output FILE] By default 'cf curl' will perform a GET to the specified PATH. If data is provided via -d, a POST will be performed instead, and the Content-Type will be set to application/json. You may override headers with -H and the request method with -X. For API documentation, please visit


cf curl "/v2/apps" -X GET -H "Content-Type: application/x-www-form-urlencoded" -d 'q=name:myapp' cf curl "/v2/apps" -d @/path/to/file



Custom headers to include in the request, flag can be specified multiple times




HTTP data to include in the request body, or '@' followed by a file name to read the data from

--fail, -f

Server errors return exit code 22


Include response headers in the output


Write curl body to FILE instead of stdout