Candle Documentation

HTTP Client

Configuration References

HTTP Components are a special type of component that allow you to define operations whose implementation is backed by an HTTP request. An HTTP operation takes inputs like any other operation and uses those inputs to build up URL paths, query parameters, and request body data.

Global configuration

See the HTTP Client component documentation for more details. Important options include:


HTTP Client Operations require a url resource to use as the base url for operation requests.


The codec defines how the request and response bodies should be encoded and decoded. See the codec documentation for allowed values.

Per-operation configuration

See the HTTP Client operation definition documentation for more details.


The inputs to HTTP Client operations are defined by the HTTP Client operation definition configurations.

outputs (unconfigurable)

  • response - The response object (status, headers, et al) returned by the HTTP request.
  • body - Bytes or JSON dependending on the codec


Example showing how to use the HTTP Client component to make HTTP requests from Wick.

Every component starts off with the common Component kind and an optional name.

kind: wick/component@v1
name: http_client_example

This example defines one operation, httpbin_get, that uses HTTPBIN to echo our query parameters back to us. Notice how we use Liquid syntax in our path to dynamically build up the URL.

- inputs:
  - name: message
    type: string
  name: httpbin_get
  path: /get?msg={{message}}

The full configuration is located at examples/components/http-client.wick.

Running on the CLI with wick invoke

Run this component on the command line by cloning the wick repository and using wick invoke.

Note: Use cargo run -p wick-cli -- invoke to run wick from source.

Clone the repository with

git clone && cd wick

Notice: the arguments to the operation come after the --.

Invoke the operation httpbin_get with the following command:

wick invoke examples/components/http-client.wick httpbin_get -- --message=[...] 

Complete Example

The full example configuration is included below,

kind: wick/component@v1
name: http_client_example
  version: 0.0.1
  description: Example showing how to use the HTTP Client component to make HTTP requests from Wick.
    - Apache-2.0
  - name: BASEURL
      kind: wick/resource/url@v1
      url: http://{{ ctx.env.HTTPBIN }}
  kind: wick/component/http@v1
  resource: BASEURL
    - name: httpbin_get
        - name: message
          type: string
      path: /get?msg={{message}}