Reference Explainer

URL Encoding

URL encoding preserves reserved characters in paths and query strings.

What It Is

  • Percent-encoding replaces unsafe bytes with % followed by hexadecimal values.
  • Query parameters and path segments have different encoding expectations.
  • Use component-level encoding to avoid double-encoding URLs.

Common Pitfalls

  • Applying encode/decode twice.
  • Encoding a full URL when only one segment should be encoded.
  • Misinterpreting '+' handling between forms and URI components.