Request command

Beta

Use the request command to forward an HTTPS request through the Passport Proxy using the stored client certificate. The Passport CLI handles mTLS directly, so no daemon is required. Use secret references in place of real secrets anywhere in the request — headers, URL paths, query parameters, or the request body. For a walkthrough, see Call an API with Passport.

You must run passport setup before sending requests. To learn more, see Setup and identity commands.

passport request

Usage

$passport request [options] <url>
<url>

The target URL. Supports secret references in {{vault:SECRET_NAME}} format.

Options

-X, --method <method>
Defaults to GET

HTTP method to use.

-H, --header <header>

HTTP header in Name: value format. Repeatable for multiple headers.

-d, --data <body>

Request body.

--show-headers

Print the response status and headers before the body.

--proxy-host <host>

Override the Passport Proxy host. Defaults to the NLB address.

--proxy-port <port>
Defaults to 8443

Override the Passport Proxy port.

--insecure-proxy-hostname

Skip the outer TLS hostname check on the upstream handshake. The certificate chain is still validated.

Examples

$passport request "https://api.example.com/data" \
> -H "x-api-key: {{vault:API_KEY}}"
$
$passport request -X POST "https://api.example.com/auth" \
> -d '{"username": "{{vault:DB_USER}}", "password": "{{vault:DB_PASS}}"}' \
> --show-headers
$
$passport request --insecure-proxy-hostname \
> "https://httpbin.org/anything/{{vault:JOKE_CHANNEL}}"