HarborClient substitutes {{variable}} placeholders in URLs, headers, params, bodies, and auth fields when you send a request. Variable filters let you transform the resolved value in place—uppercase a header, URL-encode a query string, trim whitespace—without writing a pre-request script.

The syntax is Twig-style: put a pipe and a filter name after the key. Filters apply left to right, and the request editor autocompletes filter names after you type | inside {{ }}.

How filters work

Write the variable name as usual, then add one or more filters:

{{name|upper}}
{{name|trim|upper}}
{{ q | urlencode }}
HarborClient PUT request showing {{welcome|urlencode}} in the URL and chained trim|upper filters on dynamic variables in the JSON body
Filters in a URL and body—urlencode on a path segment, trim|upper on dynamic names.

Spaces around the key and pipes are optional. HarborClient resolves the variable first (from globals, collection, folder, environment, and runtime values), then pipes that string through each filter. If the key is unknown, or a filter name is not recognized, the original {{…}} token is left unchanged in the outgoing request.

All available filters

These eight filters ship today. Each example assumes a variable whose Value is shown in the “Given” column.

upper

Uppercases the entire string.

Given: hello
{{name|upper}} → HELLO

lower

Lowercases the entire string.

Given: HELLO
{{name|lower}} → hello

capitalize

Uppercases the first character and lowercases the rest.

Given: hELLO
{{name|capitalize}} → Hello

trim

Removes leading and trailing whitespace.

Given: "  hello  "
{{name|trim}} → hello

urlencode

Percent-encodes the value for safe use in URLs (same idea as encodeURIComponent).

Given: a b&c
{{q|urlencode}} → a%20b%26c

length

Returns the string length as a decimal string.

Given: hello
{{name|length}} → 5

striptags

Removes HTML tags, leaving the text content.

Given: <p>hello</p>
{{html|striptags}} → hello

round

Rounds a numeric string to the nearest integer. Non-numeric values pass through unchanged.

Given: 3.7
{{n|round}} → 4

Given: abc
{{n|round}} → abc

Chain filters

Pipe several filters in one placeholder. Each filter receives the output of the previous one:

Given: "  hello  "
{{name|trim|upper}} → HELLO

A practical URL pattern:

GET {{baseUrl}}/search?q={{query|trim|urlencode}}

Tips

  • Autocomplete — after | inside a {{ }} token, HarborClient suggests the registered filter names.
  • No filter arguments yet — filters take the piped string only; argument support is reserved for later.
  • Unknown filters are left alone — a typo like {{name|uppper}} keeps the literal placeholder in the request so the mistake is visible.
  • Works wherever variables resolve — the same filter pipeline runs for GUI sends and for hc.request.variables.replaceIn() in scripts.

Try it

Grab the latest HarborClient from harborclient.com or GitHub Releases. Set a collection or environment variable, then try {{name|upper}} in a header or URL and send the request. For variable scopes and precedence, see Environments; for generated placeholders like {{$guid}}, see Variables.

Leave a Reply

Trending

Discover more from HarborClient Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading