percent-encode and decode url components
// encoded/decoded output appears here
curl -sX POST 'https://api.whittly.dev/v1/url/encode' \
-H 'Authorization: Bearer $WHITTLY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"input":"https://ex.com/hello world?q=a b"}'
const res = await fetch('https://api.whittly.dev/v1/url/encode', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ input: "https://ex.com/hello world?q=a b" }),
});
const data = await res.json();
const { data } = await axios.post(
'https://api.whittly.dev/v1/url/encode',
{ input: "https://ex.com/hello world?q=a b" },
{ headers: { Authorization: 'Bearer ' + apiKey } }
);
URLs may only contain a limited set of ASCII characters. Percent-encoding (URL encoding) replaces unsafe characters with a % followed by two hex digits. This tool encodes and decodes individual URL components or full URLs.