curl - Cloud Foundry CLI Reference Guide


NAME

curl - Executes a request to the targeted API endpoint

SYNTAXE

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 http://apidocs.cloudfoundry.org.

EXAMPLES

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

OPTIONS

-H

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

-X

HTTP method (GET,POST,PUT,DELETE,etc)

-d

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

-i

Include response headers in the output

--output

Write curl body to FILE instead of stdout