Documentation

http.pathEscape() function

The http.pathEscape() function escapes special characters in a string (including /) and replaces non-ASCII characters with hexadecimal representations (%XX).

Function type: Transformation

import "http"

http.pathEscape(
  inputString: "/this/is/an/example-path.html"
)

// Returns %2Fthis%2Fis%2Fan%2Fexample-path.html

Parameters

inputString

The string to escape.

Data type: String

Examples

URL-encode strings in a stream of tables
import "http"

data
  |> map(fn: (r) => ({ r with
    path: http.pathEscape(inputString: r.path)
  }))

New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: